-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange bug in PLS algorithm #88
Comments
Seems like it is caused by too small eigenvalues in SIMPLS algorithm when cross-validation is applied, so number of observations is smaller than for calibration set. Will fix by adding a check inside cross-validation loop and if number of components is too large it will raise and error and ask user to limit the number. |
Perhaps the kappa function can help you by measuring how poorly conditioned the matrix is. |
Thanks for suggestion. Actually the problem was not in the line I mentioned in the first comment, but a bit deeper, in the SIMPLS algorithm. When maximum number of components estimated or provided by user is too large (within the limits bounded by number of observations and variables but larger than the effective rank), then it causes, of course, computational issues in the algorithm. There is actually a corresponding check inside in the algorithm and if this happens the algorithm reduces the number of components and warn user about this. But if random cross-validation is used and some variables are discrete, in one of the steps there can be a local calibration set where all values for one or several such variables are constant. This further reduces the effective rank and led to the above mentioned error. The situation is very unlikely and this is why all tests passed so far until I started experimenting with some things. Will simply add another check inside cross-validation and ask user to limit number of components in this case. |
This code:
Leads to the following error (only when last command is executed):
In predict.cal() inside cross-validation loop (when
m.loc
is used):The text was updated successfully, but these errors were encountered: