seed = 301
np.random.seed(seed)
tree_hyperparams = {
'max_depth' : [3, 5, 10, 15, 20, 30, None],
'min_samples_split' : randint(32, 128),
'min_samples_leaf' : randint(32, 128),
'criterion' : ['gini', 'entropy']
}
tree_randomsearch = RandomizedSearchCV(DecisionTreeClassifier(),
tree_hyperparams,
n_iter = 16,
cv = KFold(n_splits = 5, shuffle = True),
random_state = seed)
tree_randomsearch.fit(X_badluck, y_badluck)
results_treerandom = pd.DataFrame(tree_randomsearch.cv_results_)
results_treerandom.head()
O código retorna:
TypeError: Parameter grid for parameter 'min_samples_split' is not iterable or a distribution (value=47)
Sendo que o value muda quando tento rodar novamente. Ainda não descobri o motivo para o erro.