Skip to content

Commit

Permalink
Merge pull request #20 from JuliaAI/bug-fix
Browse files Browse the repository at this point in the history
Fix a bug and bump 0.2.5
  • Loading branch information
ablaom authored Jan 9, 2024
2 parents 045363d + a207fc4 commit 594d9f0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJTestInterface"
uuid = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.2.4"
version = "0.2.5"

[deps]
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
Expand All @@ -10,5 +10,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
MLJBase = "0.20, 0.21, 1"
Pkg = "<0.0.1, 1"
Test = "<0.0.1, 1"
julia = "1.6"
3 changes: 0 additions & 3 deletions src/attemptors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ function operations(fitted_machine, data...; throw=false, verbosity=1)
model = fitted_machine.model
operations = String[]
methods = MLJBase.implemented_methods(fitted_machine.model)
if model isa Static && !(:transform in methods)
push!(methods, :transform)
end
_, test = MLJBase.partition(1:MLJBase.nrows(first(data)), 0.5)
if :predict in methods
predict(fitted_machine, first(data))
Expand Down
11 changes: 0 additions & 11 deletions test/attemptors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ MLJBase.transform(::DummyStatic, _, x, y) = hcat(x, y)
MLJBase.package_name(::Type{<:DummyStatic}) = "DummyPackage"
MLJBase.load_path(::Type{<:DummyStatic}) = "DummyPackage.Some.Thing.Different"

struct DummyStatic2 <: Static end
MLJBase.transform(::DummyStatic2, _, x, y) = hcat(x, y)
MLJBase.package_name(::Type{<:DummyStatic2}) = "DummyPackage"
MLJBase.load_path(::Type{<:DummyStatic2}) = "DummyPackage.Some.Thing.Different"
MLJBase.implemented_methods(::Type{<:DummyStatic2}) = Symbol[]

struct SupervisedTransformer <: Deterministic end
MLJBase.fit(::SupervisedTransformer, verbosity, X, y) = (42, nothing, nothing)
MLJBase.predict(::SupervisedTransformer, _, Xnew) = fill(4.5, length(Xnew))
Expand All @@ -69,11 +63,6 @@ MLJBase.load_path(::Type{<:SupervisedTransformer}) =
operations, outcome = MLJTestInterface.operations(smach, X, y)
@test operations == "transform"
@test outcome == ""

smach = machine(DummyStatic2())
operations, outcome = MLJTestInterface.operations(smach, X, y)
@test operations == "transform"
@test outcome == ""
end

true

0 comments on commit 594d9f0

Please sign in to comment.