Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

BUG Return correct prediction dims with and without lambda #53

Conversation

stephen-hoover
Copy link
Contributor

Instead of trying for a one-liner with magic squeeze behavior, only squeeze if predicting for a single lambda value, and then only squeeze off the last axis (the lambda path). This way we'll get the correct return shape for all input shapes, including single rows.

PR #51 fixed 1-row predictions for the case of single-lambda predictions with LogitNet, but didn't properly handle multi-lambda predictions, and didn't fix 1-row predictions for ElasticNet.

Closes #52 , #30 , #25 .

Instead of trying for a one-liner with magic `squeeze` behavior, only squeeze if predicting for a single lambda value, and then only squeeze off the last axis (the lambda path). This way we'll get the correct return shape for all input shapes, including single rows.
Copy link

@elsander elsander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Close all of the tickets!

@elsander elsander assigned stephen-hoover and unassigned elsander Mar 11, 2019
@stephen-hoover stephen-hoover merged commit 38c7f0a into civisanalytics:master Mar 11, 2019
@stephen-hoover stephen-hoover deleted the issue-52-elasticnet-0d-bug branch March 11, 2019 16:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ElasticNet.predict returns 0d array on 1-row inputs
2 participants