JuliaStats / Lasso.jl

Lasso/Elastic Net linear and generalized linear models
Other
143 stars 31 forks source link

cross_validate_path gen keyword arg does not work #22

Closed harryscholes closed 5 years ago

harryscholes commented 5 years ago

https://github.com/JuliaStats/Lasso.jl/blob/55718966db53679e333d8a94749e8722b082796c/src/cross_validation.jl#L27-L36

For example,

using Lasso

X = rand(100, 5)
y = rand([0., 1.], 100)

path = fit(LassoPath, X, y)
cross_validate_path(path)

produces an error UndefVarError: y not defined. Should the default value for gen be changed to gen=Kfold(length(path.m.rr.y), 10) (or similar using a function to grab y from the RegularizationPath)?

AsafManela commented 5 years ago

Yes. That's a typo. Can you please make a PR? Maybe add to it your other suggestion in #23