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

using recipes #11

Open
mkborregaard opened this issue Sep 6, 2021 · 5 comments
Open

using recipes #11

mkborregaard opened this issue Sep 6, 2021 · 5 comments

Comments

@mkborregaard
Copy link

Hi,
would it be possible/interesting to factor this package down to just using recipes rather importing all of Plots and StatsPlots (two rather heavy dependencies, in particular StatsPlots). That is the intended usage of Plots - or are there special considerations to take in terms of the needs of this package?

@AsafManela
Copy link
Owner

I think you are correct that recipes is the proper way to go. Contributions welcome.

@mkborregaard
Copy link
Author

Yeah fair enough. I don't mind trying to write the recipes but can you help a little with you are needing to do exactly here?
I see your plot code includes @df - can that data be taken from the Lasso objects instead so we only need to depend on Lasso?

@AsafManela
Copy link
Owner

It does come from Lasso objects. If I remember correctly, the df is there because before Plots it depended on Gadfly which is all about dfs.

@mkborregaard
Copy link
Author

mkborregaard commented Sep 7, 2021

Can you provide a runnable example of this package I can use as a target? None of the examples here provide sample data. I tried picking data out of one of your examples, but it would be nice to see the full range of intended functionality.

I just fell over this package and just assumed it's user ready - is it work in progress or something that can be broadly used right now? I'm asking because I am a little in doubt whether it should also be able to plot LassoModel objects, and LassoPath objects wrapped in StatsModels types?

@AsafManela
Copy link
Owner

Sure, try this one:

using DataFrames, Plots, Lasso, LassoPlot, Random
n = 100
x = rand(n)
data = DataFrame(X=x, Y=x + rand(n))
m = fit(LassoPath, @formula(Y ~ X), data)
plot(m.model)

Note that sample size n has to be large enough for 10-fold cross validation to not complain about k being too large.
If you want to stay with a small sample, you can try specifying which selectors (vertical lines) to show like here:

plot(m.model, showselectors=[MinAICc()])

About plotting StatsModels types, I think adding those methods makes sense.

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