def __init__(self, *args, **kwargs): name = kwargs.pop('name', None) if name is None: self.name = 'BooleanRuleMatcher' + '_' + get_ts() else: self.name = name self.rules = OrderedDict() self.rule_source = OrderedDict() self.rule_conjunct_list = OrderedDict() self.rule_cnt = 0
def __init__(self, *args, **kwargs): super(SVMMatcher, self).__init__() # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'SVM' + '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name # Set the classifier to the scikit-learn classifier. self.clf = SVC(*args, **kwargs)
def __init__(self, *args, **kwargs): super(SVMMatcher, self).__init__() # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'SVM'+ '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name # Set the classifier to the scikit-learn classifier. self.clf = SVC(*args, **kwargs)
def __init__(self, *args, **kwargs): name = kwargs.pop('name', None) if name is None: self.name = 'BooleanRuleMatcher' + '_' + get_ts() else: self.name = name self.rules = OrderedDict() self.rule_source = OrderedDict() self.rule_conjunct_list = OrderedDict() self.rule_cnt = 0 feature_table = kwargs.pop('feature_table', None) self.feature_table = feature_table self.rule_ft = OrderedDict()
def __init__(self, *args, **kwargs): super(LinRegMatcher, self).__init__() # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name is not given, then create one. # Currently, we use a constant string + a random number. self.name = 'LinearRegression' + '_' + get_ts() else: # set the name for the matcher. self.name = name # Wrap the class implementing linear regression classifer. self.clf = LinRegClassifierSKLearn(*args, **kwargs)
def __init__(self, *args, **kwargs): # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'LogisticRegression'+ '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name super(LogRegMatcher, self).__init__() # Set the classifier to the scikit-learn classifier. self.clf = LogisticRegression(*args, **kwargs) self.clf.classes_ = [0, 1]
def __init__(self, *args, **kwargs): # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'LogisticRegression' + '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name super(LogRegMatcher, self).__init__() # Set the classifier to the scikit-learn classifier. self.clf = LogisticRegression(*args, **kwargs) self.clf.classes_ = [0, 1]
def __init__(self, *args, **kwargs): logger.warning( "WARNING THIS MATCHER IS EXPERIMENTAL AND NOT TESTED. USE AT YOUR OWN RISK.") # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'NaiveBayes'+ '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name super(DaskNBMatcher, self).__init__() # Set the classifier to the scikit-learn classifier. self.clf = GaussianNB(*args, **kwargs)
def __init__(self, *args, **kwargs): logger.warning( "WARNING THIS MATCHER IS EXPERIMENTAL AND NOT TESTED. USE AT YOUR OWN RISK." ) # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'NaiveBayes' + '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name super(DaskNBMatcher, self).__init__() # Set the classifier to the scikit-learn classifier. self.clf = GaussianNB(*args, **kwargs)
def __init__(self, *args, **kwargs): super(XGBoostMatcher, self).__init__() # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'xgboost' + '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name # Set the classifier to the scikit-learn classifier. try: from xgboost.sklearn import XGBClassifier except ImportError: raise ImportError( 'Check if xgboost library is installed. You can install xgboost ' 'by following the instructions at http://xgboost.readthedocs.io/en/latest/build.html' ) self.clf = XGBClassifier(*args, **kwargs)
def __init__(self, *args, **kwargs): logger.warning( "WARNING THIS MATCHER IS EXPERIMENTAL AND NOT TESTED. USE AT YOUR OWN RISK.") super(DaskXGBoostMatcher, self).__init__() # If the name is given, then pop it name = kwargs.pop('name', None) if name is None: # If the name of the matcher is give, then create one. # Currently, we use a constant string + a random number. self.name = 'xgboost' + '_' + get_ts() else: # Set the name of the matcher, with the given name. self.name = name # Set the classifier to the scikit-learn classifier. try: from xgboost.sklearn import XGBClassifier except ImportError: raise ImportError( 'Check if xgboost library is installed. You can install xgboost ' 'by following the instructions at http://xgboost.readthedocs.io/en/latest/build.html') self.clf = XGBClassifier(*args, **kwargs)