8000 DOC Fix doc of defaults in sklearn.calibration.py (#18034) · scikit-learn/scikit-learn@8980458 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8980458

Browse files
authored
DOC Fix doc of defaults in sklearn.calibration.py (#18034)
1 parent 6c9d809 commit 8980458

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

sklearn/calibration.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _fit_calibrated_classifer(estimator, X, y, train, test, supports_sw,
4040
Returns
4141
-------
4242
calibrated_classifier : estimator object
43-
The calibrated estimator
43+
The calibrated estimator.
4444
"""
4545
if sample_weight is not None and supports_sw:
4646
estimator.fit(X[train], y[train],
@@ -91,7 +91,7 @@ class CalibratedClassifierCV(ClassifierMixin,
9191
use isotonic calibration with too few calibration samples
9292
``(<<1000)`` since it tends to overfit.
9393
94-
cv : integer, cross-validation generator, iterable or "prefit", \
94+
cv : int, cross-validation generator, iterable or "prefit", \
9595
default=None
9696
Determines the cross-validation splitting strategy.
9797
Possible inputs for cv are:
@@ -127,7 +127,7 @@ class CalibratedClassifierCV(ClassifierMixin,
127127
128128
.. versionadded:: 0.24
129129
130-
pre_dispatch : int, or str, default=n_jobs
130+
pre_dispatch : int or str, default='2*n_jobs'
131131
Controls the number of jobs that get dispatched during parallel
132132
execution. Reducing this number can be useful to avoid an
133133
explosion of memory consumption when more jobs get dispatched
@@ -146,14 +146,14 @@ class CalibratedClassifierCV(ClassifierMixin,
146146
147147
.. versionadded:: 0.24
148148
149-
verbose : integer
149+
verbose : int, default=0
150150
Controls the verbosity: the higher, the more messages.
151151
152152
.. versionadded:: 0.24
153153
154154
Attributes
155155
----------
156-
classes_ : array, shape (n_classes)
156+
classes_ : ndarray of shape (n_classes,)
157157
The class labels.
158158
159159
calibrated_classifiers_ : list (len() equal to cv or 1 if cv == "prefit")
@@ -231,10 +231,10 @@ def fit(self, X, y, sample_weight=None):
231231
232232
Parameters
233233
----------
234-
X : array-like, shape (n_samples, n_features)
234+
X : array-like of shape (n_samples, n_features)
235235
Training data.
236236
237-
y : array-like, shape (n_samples,)
237+
y : array-like of shape (n_samples,)
238238
Target values.
239239
240240
sample_weight : array-like of shape (n_samples,), default=None
@@ -328,12 +328,12 @@ def predict_proba(self, X):
328328
329329
Parameters
330330
----------
331-
X : array-like, shape (n_samples, n_features)
331+
X : array-like of shape (n_samples, n_features)
332332
The samples.
333333
334334
Returns
335335
-------
336-
C : array, shape (n_samples, n_classes)
336+
C : ndarray of shape (n_samples, n_classes)
337337
The predicted probas.
338338
"""
339339
check_is_fitted(self)
@@ -357,12 +357,12 @@ class that has the highest probability, and can thus be different
357357
358358
Parameters
359359
----------
360-
X : array-like, shape (n_samples, n_features)
360+
X : array-like of shape (n_samples, n_features)
361361
The samples.
362362
363363
Returns
364364
-------
365-
C : array, shape (n_samples,)
365+
C : ndarray of shape (n_samples,)
366366
The predicted class.
367367
"""
368368
check_is_fitted(self)
@@ -392,12 +392,12 @@ class _CalibratedClassifier:
392392
to offer more accurate predict_proba outputs. No default value since
393393
it has to be an already fitted estimator.
394394
395-
method : 'sigmoid' | 'isotonic'
395+
method : {'sigmoid', 'isotonic'}, default='sigmoid'
396396
The method to use for calibration. Can be 'sigmoid' which
397397
corresponds to Platt's method or 'isotonic' which is a
398398
non-parametric approach based on isotonic regression.
399399
400-
classes : array-like, shape (n_classes,), optional
400+
classes : array-like of shape (n_classes,), default=None
401401
Contains unique classes used to fit the base estimator.
402402
if None, then classes is extracted from the given target values
403403
in fit().
@@ -450,10 +450,10 @@ def fit(self, X, y, sample_weight=None):
450450
451451 6D40
Parameters
452452
----------
453-
X : array-like, shape (n_samples, n_features)
453+
X : array-like of shape (n_samples, n_features)
454454
Training data.
455455
456-
y : array-like, shape (n_samples,)
456+
y : array-like of shape (n_samples,)
457457
Target values.
458458
459459
sample_weight : array-like of shape (n_samples,), default=None
@@ -498,12 +498,12 @@ def predict_proba(self, X):
498498
499499
Parameters
500500
----------
501-
X : array-like, shape (n_samples, n_features)
501+
X : array-like of shape (n_samples, n_features)
502502
The samples.
503503
504504
Returns
505505
-------
506-
C : array, shape (n_samples, n_classes)
506+
C : ndarray of shape (n_samples, n_classes)
507507
The predicted probas. Can be exact zeros.
508508
"""
509509
n_classes = len(self.classes_)
@@ -537,10 +537,10 @@ def _sigmoid_calibration(df, y, sample_weight=None):
537537
538538
Parameters
539539
----------
540-
df : ndarray, shape (n_samples,)
540+
df : ndarray of shape (n_samples,)
541541
The decision function or predict proba for the samples.
542542
543-
y : ndarray, shape (n_samples,)
543+
y : ndarray of shape (n_samples,)
544544
The targets.
545545
546546
sample_weight : array-like of shape (n_samples,), default=None
@@ -611,10 +611,10 @@ def fit(self, X, y, sample_weight=None):
611611
612612
Parameters
613613
----------
614-
X : array-like, shape (n_samples,)
614+
X : array-like of shape (n_samples,)
615615
Training data.
616616
617-
y : array-like, shape (n_samples,)
617+
y : array-like of shape (n_samples,)
618618
Training target.
619619
620620
sample_weight : array-like of shape (n_samples,), default=None
@@ -637,12 +637,12 @@ def predict(self, T):
637637
638638
Parameters
639639
----------
640-
T : array-like, shape (n_samples,)
640+
T : array-like of shape (n_samples,)
641641
Data to predict from.
642642
643643
Returns
644644
-------
645-
T_ : array, shape (n_samples,)
645+
T_ : ndarray of shape (n_samples,)
646646
The predicted data.
647647
"""
648648
T = column_or_1d(T)

0 commit comments

Comments
 (0)
0