Skip to content

Fix undefined variables bug when no features selected (ninmax <= 0)#37

Open
bnaul wants to merge 1 commit intojonathan-taylor:mainfrom
bnaul:fix_ninmax_0
Open

Fix undefined variables bug when no features selected (ninmax <= 0)#37
bnaul wants to merge 1 commit intojonathan-taylor:mainfrom
bnaul:fix_ninmax_0

Conversation

@bnaul
Copy link

@bnaul bnaul commented Oct 28, 2025

Ran into this when testing a very wide regularization path:

When ninmax <= 0 (no features selected due to high penalty, all features ineligible, or numerical issues), the variables coefs, intercepts, and df were undefined but referenced in the return statement, causing an error.

Added else clause to initialize these variables with zeros when ninmax <= 0, ensuring the method returns valid results in all cases.

🤖 Generated with Claude Code

When ninmax <= 0 (no features selected due to high penalty, all features
ineligible, or numerical issues), the variables coefs, intercepts, and df
were undefined but referenced in the return statement, causing an error.

Added else clause to initialize these variables with zeros when ninmax <= 0,
ensuring the method returns valid results in all cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant