Exemple #1
0
 def __init__(self, outer_boundary=False, **kwargs):
     if "offset_factor" in kwargs:
         kwargs.pop("offset_factor")
     RMM2Node.__init__(self, offset_factor=0, **kwargs)
     self.set_permanent_attributes(b=1,
                                   weight=[1, 1],
                                   one_class=True,
                                   outer_boundary=outer_boundary)
Exemple #2
0
 def _execute(self, data):
     result = RMM2Node._execute(self, data)
     label = result.label
     prediction = result.prediction + 1
     if self.outer_boundary and \
             prediction < (-1.0 * self.range + 1) * 0.5:
         prediction = (-1.0 * self.range + 1) - prediction
     if prediction > 0:
         label = self.classes[1]
     elif 0 >= prediction:
         label = self.classes[0]
     return PredictionVector(prediction=prediction,
                             label=label,
                             predictor=self)
Exemple #3
0
 def _execute(self, data):
     result = RMM2Node._execute(self, data)
     label = result.label
     prediction = result.prediction + 1
     if self.outer_boundary and \
             prediction < (-1.0 * self.range + 1) * 0.5:
         prediction = (-1.0 * self.range + 1) - prediction
     if prediction > 0:
         label = self.classes[1]
     elif 0 >= prediction:
         label = self.classes[0]
     return PredictionVector(prediction=prediction,
                             label=label,
                             predictor=self)
Exemple #4
0
 def __init__(self, outer_boundary=False, **kwargs):
     if "offset_factor" in kwargs:
         kwargs.pop("offset_factor")
     RMM2Node.__init__(self, offset_factor=0, **kwargs)
     self.set_permanent_attributes(
         b=1, weight=[1, 1], one_class=True, outer_boundary=outer_boundary)