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

Wrap Scikitlearn.jl Elastic Net algorithms #112

Closed
2 tasks done
ablaom opened this issue Mar 28, 2019 · 5 comments
Closed
2 tasks done

Wrap Scikitlearn.jl Elastic Net algorithms #112

ablaom opened this issue Mar 28, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ablaom
Copy link
Member

ablaom commented Mar 28, 2019

  • sklearn.linear_model.ElasticNet : this will be ElasticNet <: Deterministic{Any} , target_type(::ElasticNet) = MLJBase.Continuous, input_types(::ElasticNet) = MLJBase.Continous

  • sklearn.linear_model.ElasticNetCV: this will be ElasticNetCV <: Deterministic{Any}, with same target_type and input_types as above. Note the sklearn model has verbose as a hyperparameter, which we will drop from the MLJ model. The MLJ fit will pass either 0 or 1 to the sklearn fit, according to whether the MLJ fit verbosity is <= 0 or > 0.

@ablaom ablaom added the enhancement New feature or request label Mar 28, 2019
@ablaom
Copy link
Member Author

ablaom commented May 2, 2019

Some extra details:

ElasticNetCV

  • Return for the report a named tuple with keys (:l1_ratio, :alpha, :n_iter, :dual_gap) whose values are fitresult.l1_ratio_, fitresult.alpha_, etc

  • Define fitted_params(::ElasticNetCV, fitresult) to be named tuple with keys (:intercept, :coef) and values given by fitresult.intercept_ and fitresult.coef_.

  • If alphas are specified, clean! should ensure they are strictly positive (set to one otherwise). The value(s) of l1_ratio must be in the interval (0, 1] (and set to one otherwise).

@ablaom
Copy link
Member Author

ablaom commented May 2, 2019

Plain ElasticNet

  • Return for the report a named tuple with keys (:n_iter, :dual_gap) whose values are fitresult.n_iter_, fitresult.dual_gap_.

  • Define fitted_params(::ElasticNet, fitresult) to be named tuple with keys (:intercept, :coef) and values given by fitresult.intercept_ and fitresult.coef_.

  • The clean! method to set alpha=1 if alpha is not strictly positive. It should set l1_ratio=1 if l1_ratio is not in the interval (0, 1].

@ValdarT
Copy link

ValdarT commented May 7, 2019

Just out of curiosity.. Why wrap scikit-learn when Julia already has a wrapper around the original Fortran code (https://github.com/JuliaStats/GLMNet.jl) as well as a native Julia implementation (https://github.com/JuliaStats/Lasso.jl)?

@ablaom
Copy link
Member Author

ablaom commented May 7, 2019

Yes, I am aware of Lasso.jl, having implemented Koala's interface for it. We doing the sklearn because it looked quick and easy for @ysimillides, who has already done some sk wraps, and (I am busy with other things). It also struck me that Lasso.jl needed a little TLC, although maybe that's changed?

If you were interested in doing implementations for GLMNet or Lasso, I'm very happy to provide guidance.

@ablaom
Copy link
Member Author

ablaom commented May 15, 2019

done

@ablaom ablaom closed this as completed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants