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

Classify workflow Outputs - not displaying .csv

mukishchezian opened this issue · comments

Kia Ora,

I have been using the classification workflow, for a binary classification with a positive class set.

However, the output only contains the figures folder and results_neuropredict.pkl

The CSV files that are specified in the neuropredict docs isnt being outputted.

I am trying to get the ROC curve and the full feature importance information - any help would be appreciated.

Thanks
Mukish

code

> C:\Users\ymye313>neuropredict_classify -y "C:/Users/Documents/Texture - 1st set data/conversion_HC_texture.pkl" -m "C:/Users/Documents/Texture - 1st set data/group.csv" -o "C:/Users/Documents/Texture - 1st set data/predict" -p MCIc -t 0.75 -n 20
> 
> neuropredict version 0.6.2 for Classification
>         Time stamp : 2023-10-29 14:19:21
> 
> Using meta data from:
>         C:\Users\Documents\Texture - 1st set data\conversion_HC_texture.pkl
> 
> Positive class specified for AUC calculation: MCIc
> 
> Requested features for analysis:
> get_pyradigm from C:\Users\Documents\Texture - 1st set data\conversion_HC_texture.pkl
> 
> Data import is done.
> 
> 
> Requested processing for the following subgroups:
> MCInc,MCIc
> 
> --------------------------------------------------------------------------------
> Processing subgroup : MCInc,MCIc (1/1)
> --------------------------------------------------------------------------------
> MCIc_MCInc:
>         85 samples, 1 modalities, dims: [14]
>         Identifiers: 0
>         Attributes: age
>         Classes n=2, sizes MCInc: 41, MCIc: 44
> 
> Ignoring imputation strategy chosen, as no missing data were found!
> 
> 
> CURRENT EXPERIMENT:
> --------------------------------------------------
> Training percentage      : 0.75
> Number of CV repetitions : 20
> Number of processors     : 4
> Dim reduction method     : variancethreshold
> Dim reduction size       : tenth
> Predictive model chosen  : randomforestclassifier
> Grid search level        : light
> 
> Estimated chance accuracy : 0.500
> 
> Saving results to:
>  C:\Users\Documents\Texture - 1st set data\predict\MCIc_MCInc
> 
> 

Hi Mukish, thanks for using neuropredict, and reporting it works well and produces the figures. Just double checked the results, and it appears the latest release does not export the CSV files yet, but all you need is actually stored in the results_neuropredict.pkl file.

I'd work on adding on documentation on using that file shortly - but this is what you need to know:

there is a dictionary of input options and output results stored in results_neuropredict.pkl file, and it can be loaded easily with:

import pickle
with open('results_neuropredict.pkl', 'rb') as rf:
    results = pickle.load(rf)

which is a dictionary with the following keys:

results_to_save = ['_workflow_type', '_checkpointing',

the metrics you are looking for, such as accuracy etc, are available in this dictionary results['results'].metric_val

the misclassified samplet IDs are stored in the dictionary results['results'].misclfd_samplets

let me know if you have any other questions.

were you able to get what you need, @mukishchezian ?