MLJ.jl icon indicating copy to clipboard operation
MLJ.jl copied to clipboard

[Tracking] Updating dependencies to CategoricalArrays 1.0

Open ablaom opened this issue 4 months ago • 3 comments

CategoricalArrays 1.0 breaks a few things in MLJ. See here for some details. Here's the rough sequence for rolling these out:

  • [x] Update CategoricalDistributions.jl and tag as breaking, v0.2.0
  • [x] Update ScientificTypes.jl
  • [x] Update StatisticalMeasures.jl
  • [x] Update StatisticalMeasuresBase.jl
  • [x] Update MLJBase.jl https://github.com/JuliaAI/MLJBase.jl/pull/1028
  • [x] MLJ https://github.com/JuliaAI/MLJ.jl/pull/1185

I will do these.

Then, in no particular order, we should review the compat requirements for the following core packages. I do not expect breakages but in a few cases we might start getting dep warnings which would be good to address these early.

  • [x] MLJTuning.jl Does not appear to need updating (tested with a draft MLJBase update)
  • [x] MLJIteration.jl ditto
  • [x] MLJEnsembles.jl https://github.com/JuliaAI/MLJEnsembles.jl/pull/42
  • [x] MLJFlux.jl (needed for MLJTransforms doc generation) https://github.com/FluxML/MLJFlux.jl/pull/311 passes tests, docs failing
  • [x] MLJTransforms (needed for testing in MLJModels) https://github.com/JuliaAI/MLJTransforms.jl/pull/61 local tests: ✔️
  • [x] MLJMultivariateStatistics (needed for MLJModels testing) https://github.com/JuliaAI/MLJMultivariateStatsInterface.jl/pull/63 local tests: ✔️
  • [x] MLJDecisionTreeInterface.jl (needed for tests in FeatureSelection.jl and MLJModels.jl) https://github.com/JuliaAI/MLJDecisionTreeInterface.jl/pull/60 local tests: ✔️
  • [x] MLJModels.jl (needed for tests in MLJBalancing) https://github.com/JuliaAI/MLJModels.jl/pull/597 local tests: ✔️
  • [x] Imbalance.jl (needed for testing MLJBalancing) https://github.com/JuliaAI/Imbalance.jl/pull/105
  • [x] MLJBalancing.jl (doesn't appear to need code changes, but depends on MLJBase)
  • [x] FeatureSelection.jl https://github.com/JuliaAI/FeatureSelection.jl/pull/30 local tests: ✔️
  • [x] ARFFFiles.jl (needed by OpenML, on which MLJ depends) https://github.com/cjdoris/ARFFFiles.jl/pull/26 local tests: ✔️
  • [x] Maxnet.jl https://github.com/tiemvanderdeure/Maxnet.jl/issues/28

Here are some other packages I've checked and don't appear to need attention:

  • MLJScikitLearnInterface

Additional action required after MLJ itself is updated:

  • [x] https://github.com/JuliaAI/MLJTransforms.jl/issues/62 (MLJTransforms)
  • [ ] https://github.com/FluxML/MLJFlux.jl/issues/312 (MLJFlux)

cc @DilumAluthge @devmotion

ablaom avatar Aug 14 '25 20:08 ablaom

And then, some packages providing implementations of the MLJ API will likely need updating to CategoricalArrays 1.0 and/or CategoricalDistributions 0.2:

The steps for updating are:

  1. update the compats
  2. change in /src and /test any reference to CategoricalArrays.levels(x) to unwrap.(CategoricalArrays.levels(x)) if necessary (or if you are not sure). Look out for postfix applications like x |> levels. Possibly one has to do something similar for any references to CategoricalArrays.unique but I haven't encountered a problem with that one yet.
  3. change any reference to MLJBase.classes or MLJModelInterface.classes to CategoricaArrays.levels (or CategoricalDistributions.levels)
  4. check tests

ablaom avatar Nov 06 '25 23:11 ablaom

Bumped into this issue today in one of our test suites. MLJ.jl is holding CategoricalArrays.jl < v1

juliohm avatar Nov 12 '25 01:11 juliohm

@juliohm MLJ is now updated. Use MLJ 0.22. It's only tagged breaking because of the change in behaviour of levels/unique; see the release notes for details.

ablaom avatar Nov 20 '25 21:11 ablaom