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

Added Size checks for logistic regression #3658

Closed
wants to merge 9 commits into from

Conversation

ViswanathBalla22
Copy link

This pull request aims to solve some tasks in issue #2820 with help of #2370 as discussed in the comments.

Tasks done :
Added size checks using CheckSameSizes and CheckSameDimensionality utilities in logistic regression

@ViswanathBalla22 ViswanathBalla22 changed the title Added Size checks for Added Size checks for logistic regression Mar 18, 2024
@@ -30,13 +31,14 @@ LogisticRegressionFunction<MatType>::LogisticRegressionFunction(
false)),
lambda(lambda)
{
// Sanity check.
if (responses.n_elem != predictors.n_cols)
if (!util::CheckSameSizes(predictors.n_cols, responses.n_elem,
Copy link
Member

Choose a reason for hiding this comment

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

CheckSameSizes has no return value:

https://github.com/mlpack/mlpack/blob/master/src/mlpack/core/util/size_checks.hpp#L35

So you have to use it outside of the if statement.

Copy link

mlpack-bot bot commented May 4, 2024

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

@mlpack-bot mlpack-bot bot added the s: stale label May 4, 2024
@mlpack-bot mlpack-bot bot closed this May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants