Skip to content

Commit

Permalink
Merge pull request #212 from JuliaAI/dev
Browse files Browse the repository at this point in the history
For a 0.8.3 release
  • Loading branch information
ablaom authored Mar 17, 2024
2 parents 39d6cb4 + 9450378 commit 4f1dd71
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJTuning"
uuid = "03970b2e-30c4-11ea-3135-d1576263f10f"
authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>"]
version = "0.8.2"
version = "0.8.3"

[deps]
ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3"
Expand Down
1 change: 1 addition & 0 deletions src/tuned_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ function event!(metamodel,
measure = E.measure,
measurement = E.measurement,
per_fold = E.per_fold,
evaluation = E,
metadata = metadata)
entry = merge(entry0, extras(tuning, history, state, E))
if verbosity > 2
Expand Down
2 changes: 1 addition & 1 deletion test/serialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end

@test MLJBase.predict(smach, X) == MLJBase.predict(mach, X)
@test fitted_params(smach) isa NamedTuple
@test report(smach) == report(mach)
@test report(smach).best_model == report(mach).best_model

rm(filename)

Expand Down
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 4f1dd71

Please sign in to comment.