| @@ 41-53 (lines=13) @@ | ||
| 38 | return scores.mean() |
|
| 39 | ||
| 40 | ||
| 41 | def model2(para, X, y): |
|
| 42 | model = GradientBoostingClassifier( |
|
| 43 | n_estimators=para["n_estimators"], |
|
| 44 | learning_rate=para["learning_rate"], |
|
| 45 | max_depth=para["max_depth"], |
|
| 46 | min_samples_split=para["min_samples_split"], |
|
| 47 | min_samples_leaf=para["min_samples_leaf"], |
|
| 48 | subsample=para["subsample"], |
|
| 49 | max_features=para["max_features"], |
|
| 50 | ) |
|
| 51 | scores = cross_val_score(model, X, y, cv=3) |
|
| 52 | ||
| 53 | return scores.mean() |
|
| 54 | ||
| 55 | ||
| 56 | search_config = { |
|
| @@ 41-53 (lines=13) @@ | ||
| 38 | return scores.mean() |
|
| 39 | ||
| 40 | ||
| 41 | def model2(para, X, y): |
|
| 42 | gbc = GradientBoostingClassifier( |
|
| 43 | n_estimators=para["n_estimators"], |
|
| 44 | learning_rate=para["learning_rate"], |
|
| 45 | max_depth=para["max_depth"], |
|
| 46 | min_samples_split=para["min_samples_split"], |
|
| 47 | min_samples_leaf=para["min_samples_leaf"], |
|
| 48 | subsample=para["subsample"], |
|
| 49 | max_features=para["max_features"], |
|
| 50 | ) |
|
| 51 | scores = cross_val_score(gbc, X, y, cv=3) |
|
| 52 | ||
| 53 | return scores.mean() |
|
| 54 | ||
| 55 | ||
| 56 | search_config = { |
|