diff --git a/Project.toml b/Project.toml index 75f581bd..b4dd7242 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJBase" uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d" authors = ["Anthony D. Blaom "] -version = "0.18.2" +version = "0.18.3" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" @@ -28,7 +28,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] -CategoricalArrays = "0.8.1, 0.9" +CategoricalArrays = "0.9, 0.10" ComputationalResources = "0.3" Distributions = "0.22, 0.23, 0.24" InvertedIndices = "1" diff --git a/src/interface/data_utils.jl b/src/interface/data_utils.jl index ea95a75b..92764cc7 100644 --- a/src/interface/data_utils.jl +++ b/src/interface/data_utils.jl @@ -17,9 +17,9 @@ MMI.int(::FI, x) = throw( MMI.int(::FI, x::Missing) = missing MMI.int(::FI, x::AbstractArray) = int.(x) -# first line is no good because it promotes type to higher ineger type: +# first line is no good because it promotes type to larger integer type: # MMI.int(::FI, x::CategoricalValue) = CategoricalArrays.levelcode(x) -MMI.int(::FI, x::CategoricalValue) = CategoricalArrays.level(x) +MMI.int(::FI, x::CategoricalValue) = CategoricalArrays.refcode(x) # ------------------------------------------------------------------------ # classes diff --git a/test/resampling.jl b/test/resampling.jl index 1e432f34..7eb81a25 100644 --- a/test/resampling.jl +++ b/test/resampling.jl @@ -321,7 +321,10 @@ end @test pairs != pairs_random # wrong target type throws error: - @test_throws Exception MLJBase.train_test_pairs(scv, rows, get.(y)) + @test_throws(Exception, + MLJBase.train_test_pairs(scv, + rows, + CategoricalArrays.unwrap.(y))) # check class distribution is preserved in a larger randomized example: N = 30