Commits

Aleš Erjavec committed a359551

Added some basic documentation for the LIBLINEAR based classifiers.

Comments (0)

Files changed (3)

Orange/classification/logreg.py

 
 
 class LibLinearLogRegLearner(Orange.core.LinearLearner):
-    """A logistic regression learner from `LIBLINEAR`_.
+    """
+    A logistic regression learner from `LIBLINEAR`_.
 
     Supports L2 regularized learning.
 
     .. _`LIBLINEAR`: http://www.csie.ntu.edu.tw/~cjlin/liblinear/
 
+    .. note::
+        Unlike :class:`LogRegLearner` this one supports multi-class
+        classification using one vs. rest strategy.
+
     """
 
     L2R_LR = Orange.core.LinearLearner.L2R_LR
             setattr(self, name, value)
 
     def __call__(self, data, weight_id=None):
+        """
+        Return a classifier trained on the `data` (`weight_id` is ignored).
+
+        :param Orange.data.Table data:
+            Training data set.
+        :param int weight_id:
+            Ignored.
+        :rval: Orange.core.LinearClassifier
+
+        .. note::
+            The :class:`Orange.core.LinearClassifier` is same class as
+            :class:`Orange.classification.svm.LinearClassifier`.
+
+        """
         if not isinstance(data.domain.class_var, Orange.feature.Discrete):
             raise TypeError("Can only learn a discrete class.")
 

docs/reference/rst/Orange.classification.logreg.rst

 
 .. autofunction:: dump
 
+
 .. autoclass:: LibLinearLogRegLearner
    :members:
+   :member-order: bysource
 
 
 Examples

docs/reference/rst/Orange.classification.svm.rst

 they are significantly faster then :class:`SVMLearner` and its
 subclasses. A down side is that they support only a linear kernel and
 can not estimate probabilities.
+
    
 .. autoclass:: Orange.classification.svm.LinearSVMLearner
    :members:
+
    
 .. autoclass:: Orange.classification.svm.MultiClassSVMLearner
    :members:
+
+
+.. class:: LinearClassifier
+
+   The classifier returned by LIBLINEAR based learners.
+
+   .. attribute:: weights
+
+      A 2 dim table of computed feature weights of the classifier,
+      one for each one vs. rest underlying binary classifier (i.e.
+      ``classifier.weights[i]`` contains the i'th class vs. rest
+      binary classifier weights. If :attr:`bias` > 0 then the bias
+      weight term is appended as the last element of the weight
+      vector.
+
+   .. attribute:: bias
+
+      The bias parameter as passed to the learner.
    
    
 SVM Based feature selection and scoring