-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
AttributeError: 'MLPRegressor' object has no attribute '_best_coefs' #24713
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
Comments
You have 2 samples and request This is really a corner case and we choose to detect it much earlier even before to start trying to optimize the problem because we don't have enough samples in the validation set. |
Be aware that you should not do any machine learning with so few samples. |
The example provided is 2 samples but it's happening with up to 10 samples. |
Yes you need at least 2 samples to compute the R2 scores. By default, you take 10% validation. so above 10 samples, you get the required 2 samples (with the rounding). |
Aha got it |
Does the earlier check actually get made? If yes, why did it not catch this case? Or was your comment a "we should detect it much earlier" -> a PR would be helpful/welcome to implement this? |
Sorry for the confusion. I meant that we should create a PR to detect this case (i.e. not enough samples to compute the validation metric) and raise an error. |
Hi @glemaitre , |
Hi @glemaitre, I hope you're doing well. I came across this issue and wanted to check if someone is already working on it. If it's still open and no one is currently assigned, I’d happily take it up and work on resolving it. Looking forward to your response. |
It looks like #24788 has been open. Before to open a new PR, I'll like to have a look at this open PR because it seems that we did not provide feedback. |
The following parameters were working fine with another dataset. When I switched to a new dataset, for some reason an
AttributeError
is occurring. Any ideas?Output:
The error occurs here:
scikit-learn/sklearn/neural_network/_multilayer_perceptron.py
Line 687 in 7c2a58d
The error also seems to completely disappear when there are more than around 10-25 training examples.
The text was updated successfully, but these errors were encountered: