Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fit OneHotEncoder without MLJBase #465

Closed
olivierlabayle opened this issue May 25, 2022 · 2 comments
Closed

fit OneHotEncoder without MLJBase #465

olivierlabayle opened this issue May 25, 2022 · 2 comments

Comments

@olivierlabayle
Copy link
Collaborator

olivierlabayle commented May 25, 2022

Hello,

I am not sure I understand if this is expected. Due to some lacking interface definition, if MLJBase is not imported, one cannot fit a OneHotEncoder:

using MLJModels, MLJModelInterface, CategoricalArrays
model = OneHotEncoder()
X = (x=categorical(["a", "b", "a"]),)
fitresult, _, _ = fit(model, 1, X)
@ablaom
Copy link
Member

ablaom commented May 25, 2022

Maybe not ideal, but not unexpected. MLJ provides model API implementers with some tools which will only work if MLJBase is imported, and these include selectrows. This was done to keep MLJModelInterface lightweight. For now, if you want use an MLJ model, your're expected to import MLJBase, even if you are not interacting though the machine interface but directly via the model interface.

In this particular instance, I suggest we wait for JuliaData/Tables.jl#278 and replace selectrows with whatever Tables.jl provides. I think Tables.jl is already a dependency of MLJModels.jl.

But there may be other such methods that need MLJBase to work.

@ablaom
Copy link
Member

ablaom commented Jun 16, 2022

Closing as essentially tracked by JuliaAI/MLJBase.jl#791

@ablaom ablaom closed this as completed Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants