Linear Learner

orange.LinearLearner is a learner that uses the LIBLINEAR library backend that is very fast on large datasets.

LinearLearner

Linear learner learnes the attribute weights using one of the four possible methods.

Attributes

solver_type
Specifiys whitch method to use. Can be one of the folowing:
  • orange.LinearLearner.L2_LR (L2-regularized logistic regression, default)
  • orange.LinearLearner.L2LOSS_SVM_DUAL
  • orange.LinearLearner.L2LOSS_SVM
  • orange.LinearLearner.L1LOSS_SVM_DUAL
Note that only L2_LR supports probabilty esstimations.
eps
Stopping criteria (default 0.01)
C
Regularization parameter (default 1.0)

LinearClassifeir

Linear classifiers that uses one class vs. rest strategy for multi-class classification. It supports probability esstimation only if it was build with L2-regularized logistic regression learner.

Attributes

weights
A list of computed weight vectors for all one class vs. rest classifiers

Examples

Part of linear-learner.py

data = orange.ExampleTable("iris") classifier = orange.LinearLearner(data) for i, cls_name in enumerate(data.domain.classVar.values): print "Attribute weights for %s vs. rest classification:\n\t" % cls_name, for attr, w in zip(data.domain.attributes, classifier.weights[i]): print "%s: %.3f " % (attr.name, w), print

Produces the output:

Attribute weights for Iris-setosa vs. rest classification: sepal length: 0.463 sepal width: 1.464 petal length: -2.251 petal width: -1.025 Attribute weights for Iris-versicolor vs. rest classification: sepal length: 0.566 sepal width: -1.482 petal length: 0.548 petal width: -1.415 Attribute weights for Iris-virginica vs. rest classification: sepal length: -1.862 sepal width: -1.640 petal length: 2.474 petal width: 2.587 ...

References

R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A Library for Large Linear Classification, Journal of Machine Learning Research 9(2008), 1871-1874. Software available at http://www.csie.ntu.edu.tw/~cjlin/liblinear