From 7d1689166463fa377e4351e8b9f5cd9030489891 Mon Sep 17 00:00:00 2001 From: Fabian Pedregosa <fabian.pedregosa@inria.fr> Date: Tue, 14 Dec 2010 19:33:35 +0100 Subject: [PATCH] Add notes on fluctiations of liblinear. --- scikits/learn/linear_model/logistic.py | 7 +++++++ scikits/learn/linear_model/sparse/logistic.py | 15 +++++++-------- scikits/learn/svm/liblinear.py | 11 +++++++++++ scikits/learn/svm/sparse/liblinear.py | 12 +++++++++++- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/scikits/learn/linear_model/logistic.py b/scikits/learn/linear_model/logistic.py index a4a18b5584..bd37a2fdaa 100644 --- a/scikits/learn/linear_model/logistic.py +++ b/scikits/learn/linear_model/logistic.py @@ -42,6 +42,13 @@ class LogisticRegression(BaseLibLinear, ClassifierMixin): -------- LinearSVC + Notes + ----- + The underlying C implementation uses a random number generator to + select features when fitting the model. It is thus not uncommon, + to have slightly different results for the same input data. If + that happens, try with a smaller eps parameter. + References ---------- LIBLINEAR -- A Library for Large Linear Classification diff --git a/scikits/learn/linear_model/sparse/logistic.py b/scikits/learn/linear_model/sparse/logistic.py index ca04d7ecd1..0cea75125a 100644 --- a/scikits/learn/linear_model/sparse/logistic.py +++ b/scikits/learn/linear_model/sparse/logistic.py @@ -45,18 +45,17 @@ class LogisticRegression(SparseBaseLibLinear, ClassifierMixin): intercept (a.k.a. bias) added to the decision function. It is available only when parameter intercept is set to True - Methods - ------- - fit(X, Y) : self - Fit the model - - predict(X) : array - Predict using the model. - See also -------- LinearSVC + Notes + ----- + The underlying C implementation uses a random number generator to + select features when fitting the model. It is thus not uncommon, + to have slightly different results for the same input data. If + that happens, try with a smaller eps parameter. + References ---------- LIBLINEAR -- A Library for Large Linear Classification diff --git a/scikits/learn/svm/liblinear.py b/scikits/learn/svm/liblinear.py index e02be399d4..7bc02de95d 100644 --- a/scikits/learn/svm/liblinear.py +++ b/scikits/learn/svm/liblinear.py @@ -43,6 +43,17 @@ class LinearSVC(BaseLibLinear, ClassifierMixin): `intercept_` : array, shape = [1] if n_classes == 2 else [n_classes] Constants in decision function. + Notes + ----- + The underlying C implementation uses a random number generator to + select features when fitting the model. It is thus not uncommon, + to have slightly different results for the same input data. If + that happens, try with a smaller eps parameter. + + See also + -------- + SVC + References ---------- LIBLINEAR -- A Library for Large Linear Classification diff --git a/scikits/learn/svm/sparse/liblinear.py b/scikits/learn/svm/sparse/liblinear.py index 57557b7f24..acac283d77 100644 --- a/scikits/learn/svm/sparse/liblinear.py +++ b/scikits/learn/svm/sparse/liblinear.py @@ -32,7 +32,6 @@ class LinearSVC(SparseBaseLibLinear, ClassifierMixin): Select the algorithm to either solve the dual or primal optimization problem. - Attributes ---------- `coef_` : array, shape = [n_features] if n_classes == 2 else [n_classes, n_features] @@ -42,6 +41,17 @@ class LinearSVC(SparseBaseLibLinear, ClassifierMixin): `intercept_` : array, shape = [1] if n_classes == 2 else [n_classes] constants in decision function + Notes + ----- + The underlying C implementation uses a random number generator to + select features when fitting the model. It is thus not uncommon, + to have slightly different results for the same input data. If + that happens, try with a smaller eps parameter. + + See also + -------- + SVC + References ---------- LIBLINEAR -- A Library for Large Linear Classification -- GitLab