@@ -27,9 +27,9 @@ y2_ = categorical(yraw[2:end], ordered=true)
2727 )
2828
2929 # Check warning when `y` is not ordered:
30- @test_logs ((:warn , MLJModels. warn_classes (levels (y_)... )),
30+ @test_logs ((:warn , MLJModels. warn_levels (levels (y_)... )),
3131 MMI. fit (model, 1 , MMI. reformat (model, X_, y1_)... ))
32- # Check predictions containing two classes
32+ # Check predictions containing two levels
3333 @test_throws ArgumentError BinaryThresholdPredictor (ConstantRegressor ())
3434 @test_logs ((:warn , r" `threshold` should be" ),
3535 BinaryThresholdPredictor (atom, threshold= - 1 ))
8888 v1 = categorical ([' a' , ' b' , ' a' ])
8989 v2 = categorical ([' a' , ' b' , ' a' , ' c' ])
9090 # Test with UnivariateFinite object
91- d1 = UnivariateFinite (MMI . classes (v1), [0.4 , 0.6 ])
91+ d1 = UnivariateFinite (levels (v1), [0.4 , 0.6 ])
9292 @test_throws ArgumentError MLJModels. _predict_threshold (d1, 0.7 )
9393 @test MLJModels. _predict_threshold (d1, (0.7 , 0.3 )) == v1[2 ]
9494 @test MLJModels. _predict_threshold (d1, [0.5 , 0.5 ]) == v1[2 ]
9595 @test MLJModels. _predict_threshold (d1, (0.4 , 0.6 )) == v1[1 ]
9696 @test MLJModels. _predict_threshold (d1, [0.2 , 0.8 ]) == v1[1 ]
97- d2 = UnivariateFinite (MMI . classes (v2), [0.4 , 0.3 , 0.3 ])
97+ d2 = UnivariateFinite (levels (v2), [0.4 , 0.3 , 0.3 ])
9898 @test_throws ArgumentError MLJModels. _predict_threshold (d2, (0.7 , 0.3 ))
9999 @test MLJModels. _predict_threshold (d2, (0.2 , 0.5 , 0.3 )) == v2[1 ]
100100 @test MLJModels. _predict_threshold (d2, [0.3 , 0.2 , 0.5 ]) == v2[2 ]
@@ -117,14 +117,14 @@ end
117117
118118 # Test with UnivariateFiniteArray oject
119119 probs1 = [0.2 0.8 ; 0.7 0.3 ; 0.1 0.9 ]
120- unf_arr1 = UnivariateFinite (MMI . classes (v1), probs1)
120+ unf_arr1 = UnivariateFinite (levels (v1), probs1)
121121 @test_throws ArgumentError MLJModels. _predict_threshold (unf_arr1, 0.7 )
122122 @test MLJModels. _predict_threshold (unf_arr1, (0.7 , 0.3 )) == [v1[2 ], v1[1 ], v1[2 ]]
123123 @test MLJModels. _predict_threshold (unf_arr1, [0.5 , 0.5 ]) == [v1[2 ], v1[1 ], v1[2 ]]
124124 @test MLJModels. _predict_threshold (unf_arr1, (0.4 , 0.6 )) == [v1[2 ], v1[1 ], v1[2 ]]
125125 @test MLJModels. _predict_threshold (unf_arr1, [0.2 , 0.8 ]) == [v1[1 ], v1[1 ], v1[2 ]]
126126 probs2 = [0.2 0.3 0.5 ;0.1 0.6 0.3 ; 0.4 0.0 0.6 ]
127- unf_arr2 = UnivariateFinite (MMI . classes (v2), probs2)
127+ unf_arr2 = UnivariateFinite (levels (v2), probs2)
128128 @test_throws ArgumentError MLJModels. _predict_threshold (unf_arr2, (0.7 , 0.3 ))
129129 @test MLJModels. _predict_threshold (unf_arr2, (0.2 , 0.5 , 0.3 )) == [v2[4 ], v2[2 ], v2[1 ]]
130130 @test MLJModels. _predict_threshold (unf_arr2, [0.3 , 0.2 , 0.5 ]) == [v2[2 ], v2[2 ], v2[1 ]]
@@ -144,7 +144,7 @@ MMI.input_scitype(::Type{<:DummyDetector}) = MMI.Table
144144
145145@testset " BinaryThresholdPredictor - ProbabilisticUnsupervisedDetector" begin
146146 detector = BinaryThresholdPredictor (DummyDetector (), threshold= 0.2 )
147- @test_throws MLJModels. ERR_CLASSES_DETECTOR MMI. fit (
147+ @test_throws MLJModels. ERR_LEVELS_DETECTOR MMI. fit (
148148 detector, 1 , MMI. reformat (detector, X_, y1_)...
149149 )
150150
0 commit comments