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

Incorrect null_devs #39

Closed
dpmerrell opened this issue Nov 23, 2019 · 0 comments · Fixed by #57
Closed

Incorrect null_devs #39

dpmerrell opened this issue Nov 23, 2019 · 0 comments · Fixed by #57

Comments

@dpmerrell
Copy link

dpmerrell commented Nov 23, 2019

The null deviations seem to be incorrect when I run GLMNet.glmnet -- I'm getting absurdly small numbers.

Example: this code

# Simulated data set
X_sim = randn((100,10));
beta_sim = randn(10);
y_sim = randn(100) .+ (X_sim * beta_sim  .+ 3.14)

sim_path = GLMNet.glmnet(X_sim, y_sim)

Produces the output:

Least Squares GLMNet Solution Path (64 solutions for 10 predictors in 266 passes):
───────────────────────────────
      df    pct_dev           λ
───────────────────────────────
 [1]   0  0.0        3.15936   
 [2]   1  0.0716368  2.87869   
 [3]   1  0.131111   2.62295   
 [4]   1  0.180487   2.38994   
 [5]   1  0.221481   2.17762   
 [6]   2  0.270351   1.98417   
.
.
.

Which seems fine -- but then when I run

sim_path.null_dev

I get an absurdly small number:

6.240013019814641e-34

In contrast, when I compute the null deviance (sum of squares) myself:

size(X_sim, 1) * var(y_sim)

I get

2389.5611952108716

Have I misunderstood something? It's easy enough to compute the null deviance on my own, but it seems like GLMNet.jl isn't computing it as advertised.

And I don't see it covered in your unit tests. So maybe this was a small blind spot.

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

Successfully merging a pull request may close this issue.

1 participant