def __init__(self, arg, **args) : """ :Parameters: - `arg` - another ModelSelector or a Param object :Keywords: - `measure` - which measure of accuracy to use for selecting the best classifier (default = 'balancedSuccessRate') supported measures are: 'balancedSuccessRate', 'successRate', 'roc', 'roc50' (you can substitute any number instead of 50) - `numFolds` - number of CV folds to use when performing model selection - `foldsToPerform` - the number of folds to actually perform """ Classifier.__init__(self, **args) if arg.__class__ == self.__class__ : self.param = arg.param.__class__(arg.param) self.measure = arg.measure self.numFolds = arg.numFolds elif arg.__class__.__name__.find('Param') >= 0 : self.param = arg.__class__(arg) else : raise ValueError, 'wrong type of input for ModelSelector' self.classifier = None
def __init__(self, arg, **args): """ :Parameters: - `arg` - another ModelSelector or a Param object :Keywords: - `measure` - which measure of accuracy to use for selecting the best classifier (default = 'balancedSuccessRate') supported measures are: 'balancedSuccessRate', 'successRate', 'roc', 'roc50' (you can substitute any number instead of 50) - `numFolds` - number of CV folds to use when performing model selection - `foldsToPerform` - the number of folds to actually perform """ Classifier.__init__(self, **args) if arg.__class__ == self.__class__: self.param = arg.param.__class__(arg.param) self.measure = arg.measure self.numFolds = arg.numFolds elif arg.__class__.__name__.find('Param') >= 0: self.param = arg.__class__(arg) else: raise ValueError, 'wrong type of input for ModelSelector' self.classifier = None
def __init__ (self, arg) : Classifier.__init__(self) if arg.__class__ == self.__class__ : self.classifiers = [classifier.__class__(classifier) for classifier in arg.classifiers] elif type(arg) == type([]) : self.classifiers = [classifier.__class__(classifier) for classifier in arg]
def __init__(self, classifier, **args) : Classifier.__init__(self, classifier, **args) if type(classifier) == type('') : return if (not hasattr(classifier, 'type')) or classifier.type != 'classifier' : raise ValueError, 'argument should be a classifier' if classifier.__class__ == self.__class__ : self.classifier = classifier.classifier.__class__( classifier.classifier) else : self.classifier = classifier.__class__(classifier)
def __init__(self, arg): Classifier.__init__(self) if arg.__class__ == self.__class__: self.classifiers = [ classifier.__class__(classifier) for classifier in arg.classifiers ] elif type(arg) == type([]): self.classifiers = [ classifier.__class__(classifier) for classifier in arg ]
def __init__(self, classifier, **args): Classifier.__init__(self, classifier, **args) if type(classifier) == type(''): return if (not hasattr(classifier, 'type')) or classifier.type != 'classifier': raise ValueError, 'argument should be a classifier' if classifier.__class__ == self.__class__: self.classifier = classifier.classifier.__class__( classifier.classifier) else: self.classifier = classifier.__class__(classifier)
def __init__(self, arg1, arg2 = None) : Classifier.__init__(self) if arg1.__class__ == self.__class__ : other = arg1 self.classifier = other.classifier.__class__(other.classifier) self.featureSelector = other.featureSelector.__class__( other.featureSelector) else : for arg in (arg1, arg2) : if arg.type == 'classifier' : self.classifier = arg.__class__(arg) elif arg.type == 'featureSelector' : self.featureSelector = arg.__class__(arg) else : raise ValueError, \ 'argument should be either classifier or featureSelector'
def __init__(self, arg=None, **args): """ :Parameters: - `arg` - another ModelSelector object :Keywords: - `C` - a list of values to try for C - `gamma` - a list of value to try for gamma - `measure` - which measure of accuracy to use for selecting the best classifier (default = 'balancedSuccessRate') supported measures are: 'balancedSuccessRate', 'successRate', 'roc', 'roc50' (you can substitute another number instead of 50) - `numFolds` - number of CV folds to use when performing model selection """ Classifier.__init__(self, arg, **args) self.classifier = None
def __init__(self, arg1, arg2=None): Classifier.__init__(self) if arg1.__class__ == self.__class__: other = arg1 self.classifier = other.classifier.__class__(other.classifier) self.featureSelector = other.featureSelector.__class__( other.featureSelector) else: for arg in (arg1, arg2): if arg.type == 'classifier': self.classifier = arg.__class__(arg) elif arg.type == 'featureSelector': self.featureSelector = arg.__class__(arg) else: raise ValueError, \ 'argument should be either classifier or featureSelector'
def __init__(self, arg = None, **args) : """ :Parameters: - `arg` - another ModelSelector object :Keywords: - `C` - a list of values to try for C - `gamma` - a list of value to try for gamma - `measure` - which measure of accuracy to use for selecting the best classifier (default = 'balancedSuccessRate') supported measures are: 'balancedSuccessRate', 'successRate', 'roc', 'roc50' (you can substitute another number instead of 50) - `numFolds` - number of CV folds to use when performing model selection """ Classifier.__init__(self, arg, **args) self.classifier = None
def __init__(self, arg) : """ :Parameters: - `arg` - a Chain object of a list of objects, each of which implements a 'train', 'test' and has a copy constructor """ Classifier.__init__(self) if arg.__class__ == self.__class__ : other = arg self.classifier = other.classifier.__class__(other.classifier) self.chain = [component.__class__(component) for component in other.chain] elif type(arg) == type([]) : self.classifier = arg[-1].__class__(arg[-1]) self.chain = [arg[i].__class__(arg[i]) for i in range(len(arg) - 1)]
def __init__(self, arg): """ :Parameters: - `arg` - a Chain object of a list of objects, each of which implements a 'train', 'test' and has a copy constructor """ Classifier.__init__(self) if arg.__class__ == self.__class__: other = arg self.classifier = other.classifier.__class__(other.classifier) self.chain = [ component.__class__(component) for component in other.chain ] elif type(arg) == type([]): self.classifier = arg[-1].__class__(arg[-1]) self.chain = [ arg[i].__class__(arg[i]) for i in range(len(arg) - 1) ]
def __init__(self, arg = None, **args) : Classifier.__init__(self, **args)