Changeset 10694:eb4617009f30 in orange
 Timestamp:
 03/30/12 13:16:08 (2 years ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/classification/svm/__init__.py
r10682 r10694 726 726 LIBLINEAR learners interface 727 727 """ 728 728 729 class LinearSVMLearner(Orange.core.LinearLearner): 729 730 """Train a linear SVM model.""" … … 732 733 L2R_L2LOSS = Orange.core.LinearLearner.L2R_L2Loss_SVC 733 734 L2R_L1LOSS_DUAL = Orange.core.LinearLearner.L2R_L1Loss_SVC_Dual 734 L2R_L1LOSS_DUAL = Orange.core.LinearLearner.L2R_L2Loss_SVC_Dual735 735 L1R_L2LOSS = Orange.core.LinearLearner.L1R_L2Loss_SVC 736 736 … … 740 740 normalization=True, **kwargs): 741 741 """ 742 :param solver_type: One of the following class constants: 743 ``LR2_L2LOSS_DUAL``, ``L2R_L2LOSS``, 744 ``LR2_L1LOSS_DUAL``, ``L2R_L1LOSS`` or 745 ``L1R_L2LOSS`` 742 :param solver_type: One of the following class constants: 743 ``L2R_L2LOSS_DUAL``, ``L2R_L2LOSS``, 744 ``L2R_L1LOSS_DUAL``, ``L1R_L2LOSS`` 745 746 The first part (``L2R`` or ``L1R``) is the regularization term 747 on the weight vector (squared or absolute norm respectively), 748 the ``L1LOSS`` or ``L2LOSS`` indicate absolute or squared 749 loss function ``DUAL`` means the optimization problem is 750 solved in the dual space (for more information see the 751 documentation on `LIBLINEAR`_). 746 752 747 753 :param C: Regularization parameter (default 1.0) 748 :type C: float 754 :type C: float 749 755 750 756 :param eps: Stopping criteria (default 0.01) … … 754 760 (default True) 755 761 :type normalization: bool 762 763 Example 764 765 >>> linear_svm = LinearSVMLearner(solver_type=LinearSVMLearner.L1R_L2LOSS, 766 ... C=2.0) 767 ... 756 768 757 769 """ … … 764 776 setattr(self, name, val) 765 777 if self.solver_type not in [self.L2R_L2LOSS_DUAL, self.L2R_L2LOSS, 766 self.L2R_L1LOSS_DUAL, self.L 2R_L1LOSS_DUAL, self.L1R_L2LOSS]:778 self.L2R_L1LOSS_DUAL, self.L1R_L2LOSS]: 767 779 import warnings 768 780 warnings.warn("""\ … … 792 804 class MultiClassSVMLearner(Orange.core.LinearLearner): 793 805 """ Multiclass SVM (Crammer and Singer) from the `LIBLINEAR`_ library. 806 794 807 """ 795 808 __new__ = _orange__new__(base=Orange.core.LinearLearner) … … 911 924 class ScoreSVMWeights(Orange.feature.scoring.Score): 912 925 """ 913 Score a feature using squares of weights of a linear SVM 914 model. 926 Score a feature using squared weights of a linear SVM model. 915 927 916 928 Example:
Note: See TracChangeset
for help on using the changeset viewer.