MLJ- Unpack not defined

Getting an error when attempting to unpack the Boston RDataset

y, X = MLJBase.unpack(boston, ==(Symbol(outcome_name)), colname -> true)
UndefVarError: unpack not defined

 [1] getproperty(::Module, ::Symbol) at .\Base.jl:13
 [2] top-level scope at In[6]:1

When I go to look up documentation:

search: uncompact

Couldn't find unpack
Perhaps you meant unstack, unlock, unmark, stack or uncompact
No documentation found.

Binding unpack does not exist.

Thoughts? Ive tried updating and re-adding the packages within the MLJ Universe.

MLJ Version=v"0.2.3"
Julia Version 1.3.1

1 Like

That’s a pretty old MLJ version (current stable is 0.9), maybe unpack didn’t exist then?


I thought it looked low… why would I have such an old version of MLJ if i just installed and updated today?

Must be something holding you back - try ]add MLJ@0.9.0 and the error message will tell you

1 Like

@Phillip_Sutton apologies, you’re experiencing the pains that I warned (on Slack) users may experience due to a significant refactoring cycle that we just completed…
@nilshg is correct.

The easiest is to rm repos that block the way (i.e. other MLJ* repos) to do so: do ] add MLJBase@0.11 and see what it tells you, remove everything until you can add it. Then add MLJ again. (You should get MLJBase 0.11, MLJ 0.9)

using MLJBase, RDatasets
boston = dataset("MASS", "boston")
y, X = unpack(boston, ==(:Crim), colname -> true)

will return

([0.00632, 0.02731, 0.02729, 0.03237, ...
β”‚ Row β”‚ Zn      β”‚ Indus   β”‚ Chas  β”‚ NOx     β”‚ Rm      β”‚ Age     β”‚ Dis     β”‚
β”‚     β”‚ Float64 β”‚ Float64 β”‚ Int64 β”‚ Float64 β”‚ Float64 β”‚ Float64 β”‚ Float64 β”‚
β”‚ 1   β”‚ 18.0    β”‚ 2.31    β”‚ 0     β”‚ 0.538   β”‚ 6.575   β”‚ 65.2    β”‚ 4.09    β”‚
β”‚ 2   β”‚ 0.0     β”‚ 7.07    β”‚ 0     β”‚ 0.469   β”‚ 6.421   β”‚ 78.9    β”‚ 4.9671  β”‚

(I just tested it)


Thanks @tlienart and @nilshg.

The problems in dependencies kept going and going. I’m on a new system and ended up reinstalling julia adn adding MLJ first. Everything seems to be working now.

1 Like