Code Monkey home page Code Monkey logo

Comments (2)

oxinabox avatar oxinabox commented on June 15, 2024

Note that this only happens if number of features >= number observations -1
see

using Lasso

X = rand(20,8)
y = rand(20)

# this is to run this step: https://github.com/JuliaStats/Lasso.jl/blob/9d099f512afb6042b1094714e0ab280cf10f3863/src/segselect.jl#L276
#   I set λ to a single variable to simplify things
path = fit(LassoPath, X,y; λ=[0.005])

# select model to replicate this step: https://github.com/JuliaStats/Lasso.jl/blob/9d099f512afb6042b1094714e0ab280cf10f3863/src/segselect.jl#L278
m1 = selectmodel(path, MinAICc());
show(m1)
m2 = selectmodel(path, MinAICc());
show(m2)
show(m1)

works completely fine

from lasso.jl.

AsafManela avatar AsafManela commented on June 15, 2024

Calculating standard errors for a lasso selected model are not a resolved problem AFAIK.
I think show fails the first time because the standard errors are all 0. You can check by running stderror(m1).
That it works on subsequent tries is a bug, that can be fixed by deep copying m.rr used in

function selectmodel(path::R, select::SegSelect) where R<:RegularizationPath

instead of changing it with each call.
Is there a way to make show display something sensible without taking a stand on standard errors?

from lasso.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.