Skip to content

[BUG] Problems with multiclass labelling #96

@KyleCheh

Description

@KyleCheh

Describe the bug
When running WORC 3.7.0 locally on Windows (Python 3.11.5, PyRadiomics 3.0.1), the experiment executes training and produces features/classification output, but no performance file is generated.

The run fails in PlotEstimator.py with fastr trace giving the following error (for full error see attachment)

WORCerrorH20 fastr trace.txt

:

  File "C:\Users\kylec\anaconda3\envs\WORCenvHCC9\Lib\site-packages\WORC\classification\SearchCV.py", line 158, in predict
    outcome[num, :, :] = est.predict_proba(X)
    ~~~~~~~^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array would exceed the maximum number of dimension of 2.

This occurs after training, so the pipeline ends without creating performance_all_0.json.

  • modus = 'multiclass_classification'

  • Called experiment.multiclass_classification(coarse=False)

  • **Labelfile example:

Patient,imaginary_label_1_class0,imaginary_label_1_class1,imaginary_label_1_class2

CT_10127,1,0,0
CT_10241,1,0,0
CT_11122,0,1,0
CT_11162,1,0,0
CT_11498,0,1,0
CT_11632,1,0,0
CT_12073,0,0,1

Script:
elif modus == 'multiclass_classification':
label_name = ['imaginary_label_1_class0', 'imaginary_label_1_class1', 'imaginary_label_1_class2']

I also tried using multiclass labelling with just a single column containing (0,1,2) and a single label, but also cant get a performance file if used that way.

Expected behavior
WORC should produce a performance JSON file for multiclass tasks. If one-hot label input is unsupported, it should fail with a clear error

Desktop

  • OS: Windows 11
  • Python: 3.11.5
  • WORC: 3.7.0
  • Fastr: 3.4.0
  • PyRadiomics: 3.0.1

Additional context
Is this the correct way to use multiclass labelling?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions