Skip to content

Commit 9b224aa

Browse files
author
Fabian Pedregosa
committed
Add type info to docstrings.
1 parent 7d16891 commit 9b224aa

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

scikits/learn/linear_model/logistic.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,49 @@ def __init__(self, penalty='l2', dual=False, eps=1e-4, C=1.0,
6262
dual=dual, loss='lr', eps=eps, C=C,
6363
fit_intercept=fit_intercept)
6464

65-
def predict_proba(self, T):
65+
def predict_proba(self, X):
6666
"""
6767
Probability estimates.
6868
6969
The returned estimates for all classes are ordered by the
7070
label of classes.
71+
72+
Parameters
73+
----------
74+
X : array-like, shape = [n_samples, n_features]
75+
76+
Returns
77+
-------
78+
T : array-like, shape = [n_samples, n_classes]
79+
Returns the probability of the sample for each class in
80+
the model, where classes are ordered by arithmetical
81+
order.
7182
"""
72-
T = np.asanyarray(T, dtype=np.float64, order='C')
73-
probas = _liblinear.predict_prob_wrap(T, self.raw_coef_,
83+
X = np.asanyarray(X, dtype=np.float64, order='C')
84+
probas = _liblinear.predict_prob_wrap(X, self.raw_coef_,
7485
self._get_solver_type(),
7586
self.eps, self.C,
7687
self.class_weight_label,
7788
self.class_weight, self.label_,
7889
self._get_bias())
7990
return probas[:,np.argsort(self.label_)]
8091

81-
def predict_log_proba(self, T):
92+
def predict_log_proba(self, X):
8293
"""
8394
Log of Probability estimates.
8495
8596
The returned estimates for all classes are ordered by the
8697
label of classes.
98+
99+
Parameters
100+
----------
101+
X : array-like, shape = [n_samples, n_features]
102+
103+
Returns
104+
-------
105+
X : array-like, shape = [n_samples, n_classes]
106+
Returns the log-probabilities of the sample for each class in
107+
the model, where classes are ordered by arithmetical
108+
order.
87109
"""
88-
return np.log(self.predict_proba(T))
110+
return np.log(self.predict_proba(X))

0 commit comments

Comments
 (0)