alexandrebarachant / covariancetoolbox

Covariance toolbox for matlab, including riemannian geometry
GNU General Public License v3.0
109 stars 52 forks source link

Warning : Nombre d'it�rations maximum atteint #1

Open sarwatfatimam opened 8 years ago

sarwatfatimam commented 8 years ago

Hi,

I am using your toolbox for classification of two-class MI BCI. However, it gives me this warning, "Warning : Nombre d'it�rations maximum atteint" when I run MDM, Discriminant Geodesic + MDM and Tangent Space LDA with reimann_mean.

I even changed the number of iterations from 100 to 10000 and 20000 in the function of reimann_mean. But no use, Somehow, this condition nidter == niterations is always satisfied resulting in a warning. Can I remove this if condition? Does this warning effects the classification accuracy? Kindly reply back as soon as possible.

Thankyou.

sarwatfatimam commented 8 years ago

Also, I am using Matlab R2015b.

alexandrebarachant commented 8 years ago

Hi, this warning indicates that the geometric mean algorithm did not converge below the stopping criterion. It happen sometimes, especially when you have a high dimensionality (lot of channel).

The consequence are, well, difficult to predict. generally speaking, it's not a proper divergence (because the function is convex), but rather an impossibility to minimize the criterion below the stopping value. Therefore your mean is oscillating around the final value without stopping. it should not impact your performance, but indicates that things are not working in an optimal way.

This problem is actually fixed in the python toolbox by deacreasing the step size of the iteration.

sarwatfatimam commented 8 years ago

I had been experimenting with this toolbox for a while. I have MEG dataset with 306 channels. I noticed that sometimes if I decrease the time samples or change frequency range, the warning appears. I extracted features using covariance toolbox (got warning in a few subjects) and when I classified it in python with scikit-learn, SVM gave me a good prediction accuracy while logistic regression ended up giving me an error "Value error: the solver needs samples of at least 2 classes in the data but the data contains only one class". Do you think this problem can be because of the warning or any other issue? Can I trust the good results that I am getting using SVM?

sarwatfatimam commented 8 years ago

Also, the prediction accuracy was significantly reduced for logistic regression as compared to SVM in subjects for which it predicted without giving an error .

alexandrebarachant commented 8 years ago

the Logistic regression error seems unrelated to this warning (or anything else in this toolbox).

did you use regularization for your covariance matrices ? matlab does not trow an error and switch to complex value, which can cause the warning. then, classification in later stages are likely to have problems.

sarwatfatimam commented 7 years ago

Sorry for the late answer. No, I haven't used any regularization method. Though, if I normalize the data and then input it, I don't get a warning. Without normalization, I do get the warning. This is only for my MEG data. EEG data does not give any warning with or without normalization. Also, the classification accuracy of MEG turns out to be higher than the EEG.