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

Return training loss from LogisticRegression #26494

Open
rachrapp opened this issue Jun 2, 2023 · 3 comments
Open

Return training loss from LogisticRegression #26494

rachrapp opened this issue Jun 2, 2023 · 3 comments

Comments

@rachrapp
Copy link

rachrapp commented Jun 2, 2023

Describe the workflow you want to enable

Currently there seems to be no way to retrieve the loss (or change in loss) when training a logistic regression model (sklearn.linear_model.LogisticRegression). If one changes the verbosity then this can be seen from the terminal, but also cannot be retrieved from stdout. This makes it unfeasible to actually plot training curves from logistic regression models.

Describe your proposed solution

Add train_loss as an attribute, same as e.g. classes_ or n_features_in_.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

@rachrapp rachrapp added Needs Triage Issue requires triage New Feature labels Jun 2, 2023
@asingh9530
Copy link

Hi @rachrapp could you check out this link here. Seems like you need to define a custom wrapper around it.

@rachrapp
Copy link
Author

rachrapp commented Jun 5, 2023

Thanks @Abhinavfreecodecamp. While this workaround does work for the SGDClassifier class, it unfortunately does not work for LogisticRegression.

@jeremiedbb
Copy link
Member

This is the kind of feature that will be possible when we have a callback API (#22000), which is still work in progress.

@thomasjpfan thomasjpfan added module:linear_model and removed Needs Triage Issue requires triage labels Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants