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
Getting the following error, while trying to specify the min_samples_split parameter, and trying to fit (some featues of X are int, some are float. The type of y is float.) ValueError: min_samples_split must be at least 2 or in (0, 1], got 1
Steps/Code to Reproduce
from sklearn.grid_search import GridSearchCV
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error
from time import time
tuned_params = {'n_estimators': [5000, 10000],
'max_depth': [2, 4],
'min_samples_split': [1, 2],
'learning_rate': [0.001, 0.01]}
print("# Tuning hyper-parameters for mean_squared_error")
gscv = GridSearchCV(GradientBoostingRegressor(loss = 'ls', random_state=0),
tuned_params, cv=5, scoring='mean_squared_error')
gscv.fit(X, y)
you can't split on a minimum of 1 sample. You can split on a minimum of 1.0 x n_samples samples. That error message should say (0.0, 1.0] (fixed in 96cc49f). If you intended 1.0 you should have used that, not 1.
Description
Getting the following error, while trying to specify the min_samples_split parameter, and trying to fit (some featues of X are int, some are float. The type of y is float.)
ValueError: min_samples_split must be at least 2 or in (0, 1], got 1
Steps/Code to Reproduce
Versions
Linux-4.4.0-51-generic-x86_64-with-debian-stretch-sid
Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
NumPy 1.11.1
SciPy 0.17.1
Scikit-Learn 0.18.1
The text was updated successfully, but these errors were encountered: