File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1
1
name = " MLJModelInterface"
2
2
uuid = " e80e1ace-859a-464e-9ed9-23947d8ae3ea"
3
3
authors = [" Thibaut Lienart and Anthony Blaom" ]
4
- version = " 0.1.4 "
4
+ version = " 0.1.5 "
5
5
6
6
[deps ]
7
7
ScientificTypes = " 321657f4-b219-11e9-178b-2701a2544e81"
Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ const REQUIRE = "(requires MLJBase to be loaded)"
6
6
errlight (s) = throw (InterfaceError (" Only `MLJModelInterface` is loaded. " *
7
7
" Import `MLJBase` in order to use `$s `." ))
8
8
9
+ # ------------------------------------------------------------------------
10
+ # categorical, note: not exported to avoid clashes; this is fine because
11
+ # MLJBase loads CategoricalArrays and MLJ interfaces should use qualified
12
+ # statements.
13
+
14
+ categorical (a... ; kw... ) = categorical (get_interface_mode (), a... ; kw... )
15
+
16
+ categorical (:: LightInterface , a... ; kw... ) = errlight (" categorical" )
17
+
9
18
# ------------------------------------------------------------------------
10
19
# matrix
11
20
Original file line number Diff line number Diff line change
1
+ @testset " categorical-light" begin
2
+ setlight ()
3
+ x = 1 : 5
4
+ @test_throws M. InterfaceError M. categorical (x)
5
+ end
6
+ @testset " categorical-full" begin
7
+ setfull ()
8
+ M. categorical (:: FI , a... ; kw... ) = categorical (a... ; kw... )
9
+ x = 1 : 5
10
+ @test M. categorical (x) == categorical (x)
11
+ end
12
+ # ------------------------------------------------------------------------
1
13
@testset " matrix-light" begin
2
14
setlight ()
3
15
X = ones (2 ,3 )
You can’t perform that action at this time.
0 commit comments