eminSerin / NBS-Predict

A prediction-based extension of network-based statistics.
GNU General Public License v3.0
29 stars 6 forks source link

Problem with compute_modelMetrics and NaN values in Matlab 2021b #24

Closed dpedrosac closed 1 year ago

dpedrosac commented 1 year ago

Dear all,

I get a quite peculiar warning which is not reproducible in all machines. When using "balanced_accuracy", it returns warnings in several test models/designs:

"y_pred contains classes not in y_true."

It originates at line 156 of this function and only happens in Matlab versions newer than 2020a. I know why the warning occurs (the division some lines above) but I can not figure out why, even when tracing it back. You have any ideas? Best, David

eminSerin commented 1 year ago

Dear David,

Thank you for your interest in our toolbox, NBS-Predict. I apologize for the delay in responding to your issue on GitHub, as I did not receive a notification for it.

Regarding your question, the warning message you are seeing is likely due to the presence of NaN values in the "y_pred" variable. Our toolbox computes the mean of prediction scores while disregarding these NaN values using the nanmean function.

This situation is common when either your input connectome is too sparse (e.g., those derived from DTI) or the p-value is too low (i.e., removing too many features). Can you please provide us with more information about your parameters and input? This will help us better understand the issue and give you the right solution.