tests/test_performance.py 1 location
|
@@ 19-28 (lines=10) @@
|
| 16 |
|
n_iter_max = 100 |
| 17 |
|
|
| 18 |
|
|
| 19 |
|
def model(para, X_train, y_train): |
| 20 |
|
model = DecisionTreeClassifier( |
| 21 |
|
criterion=para["criterion"], |
| 22 |
|
max_depth=para["max_depth"], |
| 23 |
|
min_samples_split=para["min_samples_split"], |
| 24 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 25 |
|
) |
| 26 |
|
scores = cross_val_score(model, X_train, y_train, cv=2) |
| 27 |
|
|
| 28 |
|
return scores.mean() |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
search_config = { |
tests/test_methods.py 1 location
|
@@ 17-26 (lines=10) @@
|
| 14 |
|
n_iter = 1 |
| 15 |
|
|
| 16 |
|
|
| 17 |
|
def model(para, X_train, y_train): |
| 18 |
|
model = DecisionTreeClassifier( |
| 19 |
|
criterion=para["criterion"], |
| 20 |
|
max_depth=para["max_depth"], |
| 21 |
|
min_samples_split=para["min_samples_split"], |
| 22 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 23 |
|
) |
| 24 |
|
scores = cross_val_score(model, X_train, y_train, cv=2) |
| 25 |
|
|
| 26 |
|
return scores.mean() |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
search_config = { |
tests/test_optimizers.py 1 location
|
@@ 17-26 (lines=10) @@
|
| 14 |
|
n_iter = 1 |
| 15 |
|
|
| 16 |
|
|
| 17 |
|
def model(para, X_train, y_train): |
| 18 |
|
model = DecisionTreeClassifier( |
| 19 |
|
criterion=para["criterion"], |
| 20 |
|
max_depth=para["max_depth"], |
| 21 |
|
min_samples_split=para["min_samples_split"], |
| 22 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 23 |
|
) |
| 24 |
|
scores = cross_val_score(model, X_train, y_train, cv=2) |
| 25 |
|
|
| 26 |
|
return scores.mean() |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
search_config = { |
tests/test_packages.py 1 location
|
@@ 17-26 (lines=10) @@
|
| 14 |
|
def test_sklearn(): |
| 15 |
|
from sklearn.tree import DecisionTreeClassifier |
| 16 |
|
|
| 17 |
|
def model(para, X_train, y_train): |
| 18 |
|
model = DecisionTreeClassifier( |
| 19 |
|
criterion=para["criterion"], |
| 20 |
|
max_depth=para["max_depth"], |
| 21 |
|
min_samples_split=para["min_samples_split"], |
| 22 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 23 |
|
) |
| 24 |
|
scores = cross_val_score(model, X_train, y_train, cv=3) |
| 25 |
|
|
| 26 |
|
return scores.mean() |
| 27 |
|
|
| 28 |
|
search_config = { |
| 29 |
|
model: { |
tests/_test_meta_learn.py 1 location
|
@@ 16-25 (lines=10) @@
|
| 13 |
|
y = data.target |
| 14 |
|
|
| 15 |
|
|
| 16 |
|
def model(para, X_train, y_train): |
| 17 |
|
model = DecisionTreeClassifier( |
| 18 |
|
criterion=para["criterion"], |
| 19 |
|
max_depth=para["max_depth"], |
| 20 |
|
min_samples_split=para["min_samples_split"], |
| 21 |
|
min_samples_leaf=para["min_samples_leaf"], |
| 22 |
|
) |
| 23 |
|
scores = cross_val_score(model, X_train, y_train, cv=3) |
| 24 |
|
|
| 25 |
|
return scores.mean(), model |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
search_config = { |