| @@ 56-68 (lines=13) @@ | ||
| 53 | return scores.mean() |
|
| 54 | ||
| 55 | ||
| 56 | def model_gbc(opt): |
|
| 57 | gbc = GradientBoostingClassifier( |
|
| 58 | n_estimators=opt["n_estimators"], |
|
| 59 | learning_rate=opt["learning_rate"], |
|
| 60 | max_depth=opt["max_depth"], |
|
| 61 | min_samples_split=opt["min_samples_split"], |
|
| 62 | min_samples_leaf=opt["min_samples_leaf"], |
|
| 63 | subsample=opt["subsample"], |
|
| 64 | max_features=opt["max_features"], |
|
| 65 | ) |
|
| 66 | scores = cross_val_score(gbc, X, y, cv=3) |
|
| 67 | ||
| 68 | return scores.mean() |
|
| 69 | ||
| 70 | ||
| 71 | search_space_etc = { |
|
| @@ 42-54 (lines=13) @@ | ||
| 39 | return scores.mean() |
|
| 40 | ||
| 41 | ||
| 42 | def model_gbc(opt): |
|
| 43 | gbc = GradientBoostingClassifier( |
|
| 44 | n_estimators=opt["n_estimators"], |
|
| 45 | learning_rate=opt["learning_rate"], |
|
| 46 | max_depth=opt["max_depth"], |
|
| 47 | min_samples_split=opt["min_samples_split"], |
|
| 48 | min_samples_leaf=opt["min_samples_leaf"], |
|
| 49 | subsample=opt["subsample"], |
|
| 50 | max_features=opt["max_features"], |
|
| 51 | ) |
|
| 52 | scores = cross_val_score(gbc, X, y, cv=3) |
|
| 53 | ||
| 54 | return scores.mean() |
|
| 55 | ||
| 56 | ||
| 57 | search_space_etc = { |
|
| @@ 32-44 (lines=13) @@ | ||
| 29 | return scores.mean() |
|
| 30 | ||
| 31 | ||
| 32 | def model_gbc(opt): |
|
| 33 | gbc = GradientBoostingClassifier( |
|
| 34 | n_estimators=opt["n_estimators"], |
|
| 35 | learning_rate=opt["learning_rate"], |
|
| 36 | max_depth=opt["max_depth"], |
|
| 37 | min_samples_split=opt["min_samples_split"], |
|
| 38 | min_samples_leaf=opt["min_samples_leaf"], |
|
| 39 | subsample=opt["subsample"], |
|
| 40 | max_features=opt["max_features"], |
|
| 41 | ) |
|
| 42 | scores = cross_val_score(gbc, X, y, cv=3) |
|
| 43 | ||
| 44 | return scores.mean() |
|
| 45 | ||
| 46 | ||
| 47 | search_space_rfc = { |
|