@@ 14-25 (lines=12) @@ | ||
11 | X, y = data.data, data.target |
|
12 | ||
13 | ||
14 | def model_etc(opt): |
|
15 | etc = ExtraTreesClassifier( |
|
16 | n_estimators=opt["n_estimators"], |
|
17 | criterion=opt["criterion"], |
|
18 | max_features=opt["max_features"], |
|
19 | min_samples_split=opt["min_samples_split"], |
|
20 | min_samples_leaf=opt["min_samples_leaf"], |
|
21 | bootstrap=opt["bootstrap"], |
|
22 | ) |
|
23 | scores = cross_val_score(etc, X, y, cv=3) |
|
24 | ||
25 | return scores.mean() |
|
26 | ||
27 | ||
28 | def model_rfc(opt): |
@@ 14-25 (lines=12) @@ | ||
11 | X, y = data.data, data.target |
|
12 | ||
13 | ||
14 | def model_etc(opt): |
|
15 | etc = ExtraTreesClassifier( |
|
16 | n_estimators=opt["n_estimators"], |
|
17 | criterion=opt["criterion"], |
|
18 | max_features=opt["max_features"], |
|
19 | min_samples_split=opt["min_samples_split"], |
|
20 | min_samples_leaf=opt["min_samples_leaf"], |
|
21 | bootstrap=opt["bootstrap"], |
|
22 | ) |
|
23 | scores = cross_val_score(etc, X, y, cv=3) |
|
24 | ||
25 | return scores.mean() |
|
26 | ||
27 | ||
28 | def model_rfc(opt): |