Skip to content

Commit

Permalink
add test for full evaluation objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Mar 17, 2024
1 parent 6452d68 commit 9450378
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/tuned_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,24 @@ end
@test MLJBase.predict(mach2, (; x = rand(2))) fill(42.0, 2)
end

@testset_accelerated "full evaluation object" accel begin
X, y = make_regression(100, 2)
dcr = DeterministicConstantRegressor()

homodel = TunedModel(
models=fill(dcr, 10),
resampling=Holdout(rng=StableRNG(1234)),
acceleration_resampling=accel,
measure=mae
)
homach = machine(homodel, X, y)
fit!(homach, verbosity=0);
horep = report(homach)
evaluations = getproperty.(horep.history, :evaluation)
measurements = getproperty.(evaluations, :measurement)
models = getproperty.(evaluations, :model)
@test all(==(measurements[1]), measurements)
@test all(==(dcr), models)
end

true

0 comments on commit 9450378

Please sign in to comment.