Update randomized searchCV
parent
338efa332b
commit
87db4a6457
|
@ -38,8 +38,6 @@ def predict():
|
|||
"learning_rate": [0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5],
|
||||
"max_depth": [1, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
"min_samples_split": [2, 5, 10, 15, 100],
|
||||
"ccp_alpha": [0.0, 0.001, 0.005, 0.01, 0.05],
|
||||
"loss": ["deviance", "exponential"],
|
||||
"tol": [1e-4, 1e-3, 1e-2, 1e-1, 1e-0],
|
||||
"validation_fraction": [0.1, 0.2, 0.3, 0.4, 0.5],
|
||||
"min_samples_leaf": [1, 2, 5, 10],
|
||||
|
@ -53,14 +51,16 @@ def predict():
|
|||
|
||||
# Model
|
||||
from sklearn.ensemble import GradientBoostingClassifier
|
||||
from sklearn.model_selection import GridSearchCV
|
||||
from sklearn.model_selection import RandomizedSearchCV
|
||||
|
||||
model = GridSearchCV(
|
||||
estimator=GradientBoostingClassifier(),
|
||||
param_grid=hyper_params,
|
||||
cv=5,
|
||||
model = RandomizedSearchCV(
|
||||
GradientBoostingClassifier(),
|
||||
hyper_params,
|
||||
n_iter=100000,
|
||||
scoring="roc_auc",
|
||||
n_jobs=-1,
|
||||
verbose=1
|
||||
cv=5,
|
||||
verbose=1,
|
||||
)
|
||||
|
||||
model.fit(X_train, y_train)
|
||||
|
|
Loading…
Reference in New Issue