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

Fix undefined variable #51

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GLMNet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function show(io::IO, g::GLMNetPath)
print(io, CoefTable(Union{Vector{Int},Vector{Float64}}[nactive(g.betas), g.dev_ratio, g.lambda], ["df", "pct_dev", "λ"], []))
end

function check_jerr(jerr, maxit)
function check_jerr(jerr, maxit, pmax)
if 0 < jerr < 7777
error("glmnet: memory allocation error")
elseif jerr == 7777
Expand All @@ -205,7 +205,7 @@ function check_jerr(jerr, maxit)
elseif -10001 < jerr < 0
@warn("glmnet: convergence for $(-jerr)th lambda value not reached after $maxit iterations")
elseif jerr < -10000
@warn("glmnet: number of non-zero coefficients along path exceeds $nx at $(maxit+10000)th lambda value")
@warn("glmnet: number of non-zero coefficients along path exceeds $pmax at $(maxit+10000)th lambda value")
end
end

Expand Down Expand Up @@ -241,7 +241,7 @@ end

macro check_and_return()
esc(quote
check_jerr(jerr[1], maxit)
check_jerr(jerr[1], maxit, pmax)

lmu = lmu[1]
# first lambda is infinity; changed to entry point
Expand Down