You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
ValueError: max_samples must be in range (0, 1) but got value 1.0
It seems to be related to #1065 and #1067. I have installed the mock0.9rc1 branch which has fixes for these, but my issue persists.
The HP max_samples for random forest is described as below:
max_samples: int or float, default=None
If bootstrap is True, the number of samples to draw from X to train each base estimator.
If None (default), then draw X.shape[0] samples.
If int, then draw max_samples samples.
If float, then draw max_samples * X.shape[0] samples. Thus, max_samples should be in the interval (0, 1).
New in version 0.22.
It also occurs for the ExtraTreesClassifier which has an identical signature as random forest.
But:
This issue doesn't occur for another HP max_features which also has a similar 'int' / 'float' definition.
It also doesn't occur for max_samples when using an alternative SearchCV such as RandomizedSearchCV, TuneSearchCV, OptunaSearchCV etc.
This is not a scikit-optimize issue, you are not using the predictors correctly: the notation (0, 1) denotes an open interval, meaning the bounds are invalid. 1.0 is not a valid value for max_samples and scikit-learn is telling you so.
There is no need to use any SearchCV to trigger that, just use a classifier with the invalid value:
This is not triggered by other SearchCV simply because they happen not to try the value 1.0. A simple solution to get your code to work properly is to use valid bounds, such as Real(1e-8, 1-1e-8).
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I get an error when running BayesSearchCV with the RandomForestClassifier in Scikit Learn:
The HP max_samples for random forest is described as below:
It also occurs for the ExtraTreesClassifier which has an identical signature as random forest.
But:
Here's a code snippet to replicate the error:
Has anyone encountered this? Any suggestions to resolve?
Narayan
The text was updated successfully, but these errors were encountered: