Changeset 10665:02b530c1457b in orange


Ignore:
Timestamp:
03/27/12 13:41:35 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed parameter passing in SVMLearnerEasy, fixes #1158.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/svm/__init__.py

    r10664 r10665  
    7474    :param shrinking: use shrinking heuristics  
    7575    :type shrinking: bool 
     76    :param normalization: normalize the input data prior to learning 
     77        (default ``True``) 
     78    :type normalization: bool 
    7679    :param weight: a list of class weights 
    7780    :type weight: list 
     
    8790        >>> print "CA:  %.4f" % scoring.CA(results)[0] 
    8891        CA:  0.7908 
    89          
    9092        >>> print "AUC: %.4f" % scoring.AUC(results)[0] 
    9193        AUC: 0.9565 
     
    665667    """ 
    666668 
    667     def __init__(self, **kwds): 
    668         self.folds = 4 
    669         self.verbose = 0 
    670         SVMLearner.__init__(self, **kwds) 
    671         self.learner = SVMLearner(**kwds) 
     669    def __init__(self, folds=4, verbose=0, **kwargs): 
     670        """ 
     671        :param folds: the number of folds to use in cross validation 
     672        :type folds:  int 
     673         
     674        :param verbose: verbosity of the tuning procedure. 
     675        :type verbose: int 
     676         
     677        ``kwargs`` is passed to :class:`SVMLearner` 
     678         
     679        """ 
     680        SVMLearner.__init__(self, **kwargs) 
     681        self.folds = folds 
     682        self.verbose = verbose 
     683         
     684        self.learner = SVMLearner(**kwargs) 
    672685 
    673686    def learn_classifier(self, data): 
     
    704717 
    705718class SVMLearnerSparseEasy(SVMLearnerEasy): 
    706     def __init__(self, **kwds): 
    707         SVMLearnerEasy.__init__(self, **kwds) 
    708         self.learner = SVMLearnerSparse(**kwds) 
     719    def __init__(self, folds=4, verbose=0, **kwargs): 
     720        SVMLearnerEasy.__init__(self, folds=folds, verbose=verbose, 
     721                                **kwargs) 
     722        self.learner = SVMLearnerSparse(**kwargs) 
    709723 
    710724def default_preprocessor(): 
Note: See TracChangeset for help on using the changeset viewer.