raamana / neuropredict

Easy and comprehensive assessment of predictive power, with support for neuroimaging features

Home Page:https://raamana.github.io/neuropredict/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to launch multi-class classifier

mattvan83 opened this issue · comments

Hi Pradeep,

When trying to launch multi-class classifier (whatever the classifier chosen) on a 3-class (CN, MCI, AD) problem, I got the following problem:

Traceback (most recent call last):
  File "/homes_unix/mvanhoutte/Soft/anaconda3/envs/neuropredict/bin/neuropredict", line 8, in <module>
    sys.exit(main())
  File "/homes_unix/mvanhoutte/Soft/anaconda3/envs/neuropredict/lib/python3.7/site-packages/neuropredict/__main__.py", line 11, in main
    run_workflow.cli()
  File "/homes_unix/mvanhoutte/Soft/anaconda3/envs/neuropredict/lib/python3.7/site-packages/neuropredict/run_workflow.py", line 969, in cli
    grid_search_level, classifier, feat_select_method = parse_args()
  File "/homes_unix/mvanhoutte/Soft/anaconda3/envs/neuropredict/lib/python3.7/site-packages/neuropredict/run_workflow.py", line 525, in parse_args
    class_set, subgroups, positive_class = validate_class_set(classes, user_args.sub_groups, user_args.positive_class)
  File "/homes_unix/mvanhoutte/Soft/anaconda3/envs/neuropredict/lib/python3.7/site-packages/neuropredict/run_workflow.py", line 659, in validate_class_set
    ''.format(comb))
ValueError: Subgroup all does not contain 2 unique classes! Each subgroup must contain atleast two classes for classification experiments.

I don't understand since I have well defined 3-class in the metadata.csv file and used the following command line:

  neuropredict -m meta_data.csv \
  -d metaROI.csv metaROI_split.csv HCP_parcellation.csv \
  -t 0.8 -n 250 -k 'all' --sub_groups 'all' --gs_level 'exhaustive' \
  --feat_select_method 'variancethreshold' --classifier ${classifier} --make_vis ./visu \
  --num_procs ${NCPU} --print_options ./options

Could you help me?
Best,
Matthieu

Hi Matthieu,

when you want to use all classes, you don't need to specify --sub_groups all, that happens by default. Remove that arg and try again?

Your usage should work, I will fix the bug.

PS: will respond to email your soon, been busy with other things last week.

Also, don't use "--print_options " in the initial run. It can only be used on existing previously-run outputs.

same with --make_vis : It can only be used on existing previously-run outputs.

Hi Pradeep,

Thanks for these recommendations, I will try these.