-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG+1] Make cross-validators data independent + Reorganize grid_search, cross_validation and learning_curve into model_selection #4294
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
Changes from all commits
cfe96ed
c823a30
e265aa8
616bb0b
e4e52b9
a068691
6a0d2fc
bdd94e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
""" | ||
Logistic Regression | ||
""" | ||
|
@@ -32,7 +33,7 @@ | |
from ..utils.fixes import expit | ||
from ..utils.multiclass import check_classification_targets | ||
from ..externals.joblib import Parallel, delayed | ||
from ..cross_validation import check_cv | ||
from ..model_selection import check_cv | ||
from ..externals import six | ||
from ..metrics import SCORERS | ||
|
||
|
@@ -1309,7 +1310,7 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator, | |
cv : integer or cross-validation generator | ||
The default cross-validation generator used is Stratified K-Folds. | ||
If an integer is provided, then it is the number of folds used. | ||
See the module :mod:`sklearn.cross_validation` module for the | ||
See the module :mod:`sklearn.model_selection` module for the | ||
list of possible cross-validation objects. | ||
|
||
penalty : str, 'l1' or 'l2' | ||
|
@@ -1506,8 +1507,8 @@ def fit(self, X, y, sample_weight=None): | |
check_consistent_length(X, y) | ||
|
||
# init cross-validation generator | ||
cv = check_cv(self.cv, X, y, classifier=True) | ||
folds = list(cv) | ||
cv = check_cv(self.cv, y, classifier=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Goes into #5053 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really, that was for backward-incompatible changes, not minor refactoring. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @amueller do I leave it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
folds = list(cv.split(X, y)) | ||
|
||
self._enc = LabelEncoder() | ||
self._enc.fit(y) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not the colon that messes up the formatting here. Sphinx takes the first word in each line and auto-links it.

Use the numpydoc syntax: keep the colon, but indent the lines of the description. This should do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not addressed yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to render properly here - http://rvraghav93.github.io/doc_builds/modules/generated/sklearn.model_selection.KFold.html#sklearn.model_selection.KFold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC for multi line description the colon needs to be removed I think...