@@ -37,4 +37,32 @@ MLJBase.load_path(::Type{<:DummyModel}) = "DummyPackage.Some.Where.Over.The.Rain
37
37
@test outcome == " ✓"
38
38
end
39
39
40
+ struct DummyStatic <: Static end
41
+ MLJBase. transform (:: DummyStatic , _, x, y) = hcat (x, y)
42
+ MLJBase. package_name (:: Type{<:DummyStatic} ) = " DummyPackage"
43
+ MLJBase. load_path (:: Type{<:DummyStatic} ) = " DummyPackage.Some.Thing.Different"
44
+
45
+ struct SupervisedTransformer <: Deterministic end
46
+ MLJBase. fit (:: SupervisedTransformer , verbosity, X, y) = (42 , nothing , nothing )
47
+ MLJBase. predict (:: SupervisedTransformer , _, Xnew) = fill (4.5 , length (Xnew))
48
+ MLJBase. transform (model:: SupervisedTransformer , Θ, Xnew) =
49
+ predict (model, Θ, Xnew)
50
+ MLJBase. package_name (:: Type{<:SupervisedTransformer} ) = " DummyPackage"
51
+ MLJBase. load_path (:: Type{<:SupervisedTransformer} ) =
52
+ " DummyPackage.Some.Thing.Else"
53
+
54
+ @testset " operations" begin
55
+ X = fill (1.2 , 10 )
56
+ y = X
57
+ mach = machine (SupervisedTransformer (), X, y) |> fit!
58
+ operations, outcome = MLJTestInterface. operations (mach, X, y, throw= true )
59
+ @test operations == " predict, transform"
60
+ @test outcome == " ✓"
61
+
62
+ smach = machine (DummyStatic ())
63
+ operations, outcome = MLJTestInterface. operations (smach, X, y)
64
+ @test operations == " transform"
65
+ @test outcome == " ✓"
66
+ end
67
+
40
68
true
0 commit comments