|
@@ 62-79 (lines=18) @@
|
| 59 |
|
opt.search(search_config) |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
def test_long_term_memory_without_data(): |
| 63 |
|
def model3(para, X_train, y_train): |
| 64 |
|
model = DecisionTreeClassifier( |
| 65 |
|
criterion=para["criterion"], max_depth=para["max_depth"] |
| 66 |
|
) |
| 67 |
|
scores = cross_val_score(model, X_train, y_train, cv=2) |
| 68 |
|
|
| 69 |
|
return scores.mean() |
| 70 |
|
|
| 71 |
|
search_config = { |
| 72 |
|
model3: {"criterion": ["gini", "entropy"], "max_depth": range(1, 11)} |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
opt = Hyperactive(X, y, memory="long") |
| 76 |
|
opt.search(search_config, n_iter=0) |
| 77 |
|
|
| 78 |
|
opt = Hyperactive(X, y, memory="long") |
| 79 |
|
opt.search(search_config) |
| 80 |
|
|
| 81 |
|
|
| 82 |
|
def test_long_term_memory_best_model(): |
|
@@ 42-59 (lines=18) @@
|
| 39 |
|
assert diff_time_0 / 2 > diff_time_1 |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
def test_long_term_memory_with_data(): |
| 43 |
|
def model2(para, X_train, y_train): |
| 44 |
|
model = DecisionTreeClassifier( |
| 45 |
|
criterion=para["criterion"], max_depth=para["max_depth"] |
| 46 |
|
) |
| 47 |
|
scores = cross_val_score(model, X_train, y_train, cv=2) |
| 48 |
|
|
| 49 |
|
return scores.mean() |
| 50 |
|
|
| 51 |
|
search_config = { |
| 52 |
|
model2: {"criterion": ["gini", "entropy"], "max_depth": range(1, 11)} |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
opt = Hyperactive(X, y, memory="long") |
| 56 |
|
opt.search(search_config) |
| 57 |
|
|
| 58 |
|
opt = Hyperactive(X, y, memory="long") |
| 59 |
|
opt.search(search_config) |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
def test_long_term_memory_without_data(): |