Skip to content

Commit

Permalink
Merge pull request #545 from alan-turing-institute/dev
Browse files Browse the repository at this point in the history
For a 0.18.3 release
  • Loading branch information
ablaom authored Apr 30, 2021
2 parents 510db30 + c9fc6f3 commit e8233a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJBase"
uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.18.2"
version = "0.18.3"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/interface/data_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion test/resampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8233a5

Please sign in to comment.