Skip to content

Commit 458b03c

Browse files
committed
fix flawed test
1 parent 671491c commit 458b03c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/integration/ensembling.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,14 @@ Xtest = Tables.subset(X, test)
194194
ŷ7 = predict(model, Xtest)
195195

196196
# compare with cold restart:
197-
model = fit(LearnAPI.clone(algorithm; n=7), Xtrain, y[train]; verbosity=0);
198-
@test ŷ7 predict(model, Xtest)
197+
model_cold = fit(LearnAPI.clone(algorithm; n=7), Xtrain, y[train]; verbosity=0);
198+
@test ŷ7 predict(model_cold, Xtest)
199199

200-
# test cold restart if another hyperparameter is changed:
200+
# test that we get a cold restart if another hyperparameter is changed:
201201
model2 = update(model, Xtrain, y[train]; atom=Ridge(0.05))
202-
algorithm2 = LearnAPI.clone(LearnAPI.algorithm(model); atom=Ridge(0.05))
203-
@test predict(model, Xtest) predict(model2, Xtest)
202+
algorithm2 = Ensemble(Ridge(0.05); n=7, rng)
203+
model_cold = fit(algorithm2, Xtrain, y[train]; verbosity=0)
204+
@test predict(model2, Xtest) predict(model_cold, Xtest)
204205

205206
end
206207

0 commit comments

Comments
 (0)