Skip to content

Commit 4f1dd71

Browse files
authored
Merge pull request #212 from JuliaAI/dev
For a 0.8.3 release
2 parents 39d6cb4 + 9450378 commit 4f1dd71

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJTuning"
22
uuid = "03970b2e-30c4-11ea-3135-d1576263f10f"
33
authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>"]
4-
version = "0.8.2"
4+
version = "0.8.3"
55

66
[deps]
77
ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3"

src/tuned_models.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ function event!(metamodel,
441441
measure = E.measure,
442442
measurement = E.measurement,
443443
per_fold = E.per_fold,
444+
evaluation = E,
444445
metadata = metadata)
445446
entry = merge(entry0, extras(tuning, history, state, E))
446447
if verbosity > 2

test/serialization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ end
5151

5252
@test MLJBase.predict(smach, X) == MLJBase.predict(mach, X)
5353
@test fitted_params(smach) isa NamedTuple
54-
@test report(smach) == report(mach)
54+
@test report(smach).best_model == report(mach).best_model
5555

5656
rm(filename)
5757

test/tuned_models.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,24 @@ end
455455
@test MLJBase.predict(mach2, (; x = rand(2))) fill(42.0, 2)
456456
end
457457

458+
@testset_accelerated "full evaluation object" accel begin
459+
X, y = make_regression(100, 2)
460+
dcr = DeterministicConstantRegressor()
461+
462+
homodel = TunedModel(
463+
models=fill(dcr, 10),
464+
resampling=Holdout(rng=StableRNG(1234)),
465+
acceleration_resampling=accel,
466+
measure=mae
467+
)
468+
homach = machine(homodel, X, y)
469+
fit!(homach, verbosity=0);
470+
horep = report(homach)
471+
evaluations = getproperty.(horep.history, :evaluation)
472+
measurements = getproperty.(evaluations, :measurement)
473+
models = getproperty.(evaluations, :model)
474+
@test all(==(measurements[1]), measurements)
475+
@test all(==(dcr), models)
476+
end
477+
458478
true

0 commit comments

Comments
 (0)