Esempio n. 1
0
 def __init__(self, modeldir=None):
     BaseClassifier.__init__(self, modeldir)
     self.classes = 46
     self.class_sample_num = 5
     self.sample_size = 15#15*15
     self.model = None
     self.model_type = 1 #1=knearest, 2=svm
     self.k_neighbor_num = 5
Esempio n. 2
0
 def __init__(self, classes=24, samplepercls=10, modeltype=1, modeldir=None):
     BaseClassifier.__init__(self, modeldir)
     
     self.classes = classes
     self.class_sample_num = samplepercls
     
     self.model_type = modeltype #1=knearest, 2=svm
     self.k_neighbor_num = 5
     self.sample_size = 15#15*15
     
     self.model = None
Esempio n. 3
0
    def __init__(self, features, target_names, bins=default_bins, postprocess=None):
        """
        Initialize the classifier.
        @param features: see `BaseClassifier.__init__()`.
        @param target_names: see `BaseClassifier.__init__()`.
        @param bins: A list of interval borders as generated by `initialize_bins`.
        @param postprocess: A function that can be called to postprocess the generated recommendations in some manner.
        At the moment, static cutoff and dynamic cutoff are defined as postprocessing methods.
        @return:
        """
        BaseClassifier.__init__(self, features, target_names)
        self.bins = bins
        self.postprocess = postprocess

        #make an index that allows fast lookup of index of the correct timedelta column for each sensor
        self.timedelta_column_for_sensor = {sensor: self.timedelta_columns.index("%s_timedelta" % sensor)
                                            for sensor, value in self.settings_columns}
Esempio n. 4
0
    def __init__(self,
                 features,
                 target_names,
                 bins=default_bins,
                 postprocess=None):
        """
        Initialize the classifier.
        @param features: see `BaseClassifier.__init__()`.
        @param target_names: see `BaseClassifier.__init__()`.
        @param bins: A list of interval borders as generated by `initialize_bins`.
        @param postprocess: A function that can be called to postprocess the generated recommendations in some manner.
        At the moment, static cutoff and dynamic cutoff are defined as postprocessing methods.
        @return:
        """
        BaseClassifier.__init__(self, features, target_names)
        self.bins = bins
        self.postprocess = postprocess

        #make an index that allows fast lookup of index of the correct timedelta column for each sensor
        self.timedelta_column_for_sensor = {
            sensor: self.timedelta_columns.index("%s_timedelta" % sensor)
            for sensor, value in self.settings_columns
        }
Esempio n. 5
0
 def __init__(self, features, target_names):
     BaseClassifier.__init__(self, features, target_names)
Esempio n. 6
0
 def __init__(self, features, target_names):
     BaseClassifier.__init__(self, features, target_names)