diff --git a/scikits/learn/linear_model/logistic.py b/scikits/learn/linear_model/logistic.py index bd37a2fdaa0940c61f9c1f6ad7316cf70911a9ac..e2e7eef4527fd274b7bf4f64e41e979ede56d365 100644 --- a/scikits/learn/linear_model/logistic.py +++ b/scikits/learn/linear_model/logistic.py @@ -62,15 +62,26 @@ class LogisticRegression(BaseLibLinear, ClassifierMixin): dual=dual, loss='lr', eps=eps, C=C, fit_intercept=fit_intercept) - def predict_proba(self, T): + def predict_proba(self, X): """ Probability estimates. The returned estimates for all classes are ordered by the label of classes. + + Parameters + ---------- + X : array-like, shape = [n_samples, n_features] + + Returns + ------- + T : array-like, shape = [n_samples, n_classes] + Returns the probability of the sample for each class in + the model, where classes are ordered by arithmetical + order. """ - T = np.asanyarray(T, dtype=np.float64, order='C') - probas = _liblinear.predict_prob_wrap(T, self.raw_coef_, + X = np.asanyarray(X, dtype=np.float64, order='C') + probas = _liblinear.predict_prob_wrap(X, self.raw_coef_, self._get_solver_type(), self.eps, self.C, self.class_weight_label, @@ -78,11 +89,22 @@ class LogisticRegression(BaseLibLinear, ClassifierMixin): self._get_bias()) return probas[:,np.argsort(self.label_)] - def predict_log_proba(self, T): + def predict_log_proba(self, X): """ Log of Probability estimates. The returned estimates for all classes are ordered by the label of classes. + + Parameters + ---------- + X : array-like, shape = [n_samples, n_features] + + Returns + ------- + X : array-like, shape = [n_samples, n_classes] + Returns the log-probabilities of the sample for each class in + the model, where classes are ordered by arithmetical + order. """ - return np.log(self.predict_proba(T)) + return np.log(self.predict_proba(X))