Skip to content

[MRG] DOC Numpy doc validations to LogisticRegression #15445

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

Merged
merged 11 commits into from
Nov 2, 2019

Conversation

tolaa001
Copy link
Contributor

@tolaa001 tolaa001 commented Nov 2, 2019

Reference Issues/PRs

Contribution to fix part of #15440

What does this implement/fix? Explain your changes.

Ensuring LogisticRegression methods pass NumPy doc validation

@tolaa001 tolaa001 changed the title MRG: Numpy doc validations to LogisticRegression [MRG] DOC Numpy doc validations to LogisticRegression Nov 2, 2019
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

A couple of changes

sklearn/base.py Outdated
Parameters
----------
**params : dict
Estimator parameters.
Copy link
Member

Choose a reason for hiding this comment

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

You should spaces (4 spaces) instead of a tabulation

Copy link
Member

Choose a reason for hiding this comment

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

You still have 4 spaces too much :)

sklearn/base.py Outdated

Parameters
----------
deep : boolean, optional
deep : bool, optional
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
deep : bool, optional
deep : bool, default=True

sklearn/base.py Outdated
Returns
-------
self
self: object
Copy link
Member

Choose a reason for hiding this comment

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

4 spaces too much

sklearn/base.py Outdated
Returns
-------
self
self: object
Estimator instance.
Copy link
Member

Choose a reason for hiding this comment

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

4 spaces too much

@@ -210,7 +210,8 @@ def _decision_function(self, X):
dense_output=True) + self.intercept_

def predict(self, X):
"""Predict using the linear model
"""
Predict using the linear model
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Predict using the linear model
Predict using the linear model.

@@ -1622,6 +1623,8 @@ def predict_proba(self, X):
Parameters
----------
X : array-like of shape (n_samples, n_features)
Scoring vector, where n_samples is the number of samples and
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Scoring vector, where n_samples is the number of samples and
Vector to be scored, where `n_samples` is the number of samples and

@@ -1622,6 +1623,8 @@ def predict_proba(self, X):
Parameters
----------
X : array-like of shape (n_samples, n_features)
Scoring vector, where n_samples is the number of samples and
n_features is the number of features.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
n_features is the number of features.
`n_features` is the number of features.

@@ -1647,14 +1650,17 @@ def predict_proba(self, X):
return softmax(decision_2d, copy=False)

def predict_log_proba(self, X):
"""Log of probability estimates.
"""
Log of probability estimates.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Log of probability estimates.
Predict logarithm of probability estimates.


The returned estimates for all classes are ordered by the
label of classes.

Parameters
----------
X : array-like of shape (n_samples, n_features)
Scoring vector, where n_samples is the number of samples and
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Scoring vector, where n_samples is the number of samples and
Vector to be scored, where n_samples is the number of samples and

@glemaitre glemaitre merged commit 9c2c263 into scikit-learn:master Nov 2, 2019
@glemaitre
Copy link
Member

@tolaa001 Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants