From 7fac6ce1e382ed644d8c907e8ec2f823a79962ba Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 31 May 2024 12:23:47 +1200 Subject: [PATCH 1/4] bump 0.8.7 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f5f4cf6..239d3f7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJTuning" uuid = "03970b2e-30c4-11ea-3135-d1576263f10f" authors = ["Anthony D. Blaom "] -version = "0.8.6" +version = "0.8.7" [deps] ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3" From e0cc28ea00427d915e8944ff02156e0b93c2f442 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 31 May 2024 12:24:40 +1200 Subject: [PATCH 2/4] bump [compat] MLJBase = "1.4" --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 239d3f7..2a6c764 100644 --- a/Project.toml +++ b/Project.toml @@ -18,7 +18,7 @@ StatisticalMeasuresBase = "c062fc1d-0d66-479b-b6ac-8b44719de4cc" ComputationalResources = "0.3" Distributions = "0.22,0.23,0.24, 0.25" LatinHypercubeSampling = "1.7.2" -MLJBase = "1.3" +MLJBase = "1.4" ProgressMeter = "1.7.1" RecipesBase = "0.8,0.9,1" StatisticalMeasuresBase = "0.1.1" From c8ddd4c1dffa6430d79aa08a0c5ab9d5385003ab Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 3 Jun 2024 19:47:55 +1200 Subject: [PATCH 3/4] overload constructor trait for TunedModel types --- src/tuned_models.jl | 11 +++++++---- test/tuned_models.jl | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tuned_models.jl b/src/tuned_models.jl index a77361e..70a35a9 100644 --- a/src/tuned_models.jl +++ b/src/tuned_models.jl @@ -905,6 +905,10 @@ function MLJBase.feature_importances(::EitherTunedModel, fitresult, report) return MLJBase.feature_importances(fitresult) end + + + + ## METADATA MLJBase.is_wrapper(::Type{<:EitherTunedModel}) = true @@ -912,10 +916,8 @@ MLJBase.supports_weights(::Type{<:EitherTunedModel{<:Any,M,L}}) where {M,L} = MLJBase.supports_weights(M) MLJBase.supports_class_weights(::Type{<:EitherTunedModel{<:Any,M,L}}) where {M,L} = MLJBase.supports_class_weights(M) -MLJBase.load_path(::Type{<:ProbabilisticTunedModel}) = - "MLJTuning.ProbabilisticTunedModel" -MLJBase.load_path(::Type{<:DeterministicTunedModel}) = - "MLJTuning.DeterministicTunedModel" +MLJBase.load_path(::Type{<:EitherTunedModel}) = + "MLJTuning.TunedModel" MLJBase.package_name(::Type{<:EitherTunedModel}) = "MLJTuning" MLJBase.package_uuid(::Type{<:EitherTunedModel}) = "03970b2e-30c4-11ea-3135-d1576263f10f" @@ -928,3 +930,4 @@ MLJBase.input_scitype(::Type{<:EitherTunedModel{T,M,L}}) where {T,M,L} = MLJBase.input_scitype(M) MLJBase.target_scitype(::Type{<:EitherTunedModel{T,M,L}}) where {T,M,L} = MLJBase.target_scitype(M) +MLJBase.constructor(::Type{<:EitherTunedModel}) = TunedModel diff --git a/test/tuned_models.jl b/test/tuned_models.jl index 9826dae..833603f 100644 --- a/test/tuned_models.jl +++ b/test/tuned_models.jl @@ -69,6 +69,7 @@ end TunedModel(first(r), last(r), range=r, measure=l2), ) tm = @test_logs TunedModel(model=first(r), range=r, measure=l2) + @test MLJBase.constructor(tm) == TunedModel @test tm.tuning isa RandomSearch @test input_scitype(tm) == Table(Continuous) From b4fbf67bb8d7f53a067da65e08188381907bbe37 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 3 Jun 2024 20:42:17 +1200 Subject: [PATCH 4/4] add test to fix codecov complaint --- test/tuned_models.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/tuned_models.jl b/test/tuned_models.jl index 833603f..f99f799 100644 --- a/test/tuned_models.jl +++ b/test/tuned_models.jl @@ -70,6 +70,7 @@ end ) tm = @test_logs TunedModel(model=first(r), range=r, measure=l2) @test MLJBase.constructor(tm) == TunedModel + @test MLJBase.load_path(tm) == "MLJTuning.TunedModel" @test tm.tuning isa RandomSearch @test input_scitype(tm) == Table(Continuous)