Esempio n. 1
0
    def create_micromodel(self):
        pred_index = _to_cpp_array_int(self.prediction_column)
        cond_index= _to_cpp_array_int(self.conditional_column)
        self._saved_model = _IscMarkovGaussMicroModel(pred_index, len(self.prediction_column),
                                         cond_index, len(self.conditional_column))

        pyisc._free_array_int(pred_index)
        pyisc._free_array_int(cond_index)

        return self._saved_model
Esempio n. 2
0
    def create_micromodel(self):
        pred_index = _to_cpp_array_int(self.prediction_column)
        cond_index = _to_cpp_array_int(self.conditional_column)
        self._saved_model = _IscMarkovGaussMicroModel(
            pred_index, len(self.prediction_column), cond_index,
            len(self.conditional_column))

        pyisc._free_array_int(pred_index)
        pyisc._free_array_int(cond_index)

        return self._saved_model
Esempio n. 3
0
    def _anomaly_score_intfloat(self, x_intfloat, length, data_object):
        deviations = pyisc._double_array(self.num_of_partitions)
        min = pyisc._intfloat_array(length)
        max = pyisc._intfloat_array(length)
        peak = pyisc._intfloat_array(length)
        anom = pyisc._double_array(1)
        cla = pyisc._int_array(1)
        clu = pyisc._int_array(1)

        self._anomaly_detector._CalcAnomalyDetails(x_intfloat,anom, cla, clu, deviations, peak, min, max)

        if self.is_clustering and self.class_column > -1:
            result = [pyisc._get_double_value(anom,0),
                    pyisc._get_int_value(cla,0),
                    pyisc._get_int_value(clu,0),
                    list(pyisc._to_numpy_array(deviations,self.num_of_partitions)),
                    list(data_object._convert_to_numpyarray(peak, length)),
                    list(data_object._convert_to_numpyarray(min, length)),
                    list(data_object._convert_to_numpyarray(max, length))]
        elif self.is_clustering:
            result = [pyisc._get_double_value(anom,0),
                    pyisc._get_int_value(clu,0),
                    list(pyisc._to_numpy_array(deviations,self.num_of_partitions)),
                    list(data_object._convert_to_numpyarray(peak, length)),
                    list(data_object._convert_to_numpyarray(min, length)),
                    list(data_object._convert_to_numpyarray(max, length))]
        elif self.class_column > -1:
            result = [pyisc._get_double_value(anom,0),
                    pyisc._get_int_value(cla,0),
                    list(pyisc._to_numpy_array(deviations,self.num_of_partitions)),
                    list(data_object._convert_to_numpyarray(peak, length)),
                    list(data_object._convert_to_numpyarray(min, length)),
                    list(data_object._convert_to_numpyarray(max, length))]
        else:
            result = [pyisc._get_double_value(anom,0),
                    list(pyisc._to_numpy_array(deviations,self.num_of_partitions)),
                    list(data_object._convert_to_numpyarray(peak, length)),
                    list(data_object._convert_to_numpyarray(min, length)),
                    list(data_object._convert_to_numpyarray(max, length))]

        pyisc._free_array_double(deviations);
        pyisc._free_array_intfloat(min)
        pyisc._free_array_intfloat(max)
        pyisc._free_array_intfloat(peak)
        pyisc._free_array_double(anom)
        pyisc._free_array_int(cla)
        pyisc._free_array_int(clu)


        return result
Esempio n. 4
0
 def create_micromodel(self):
     column_array = _to_cpp_array_int(self.column_index)
     self._saved_model = _IscMultiGaussianMicroModel(len(self.column_index), column_array)
     pyisc._free_array_int(column_array)
     return self._saved_model
Esempio n. 5
0
 def create_micromodel(self):
     value_array = _to_cpp_array_int(self.value_columns)
     self._saved_model = _IscMarkovGaussMatrixMicroModel(value_array, len(self.value_columns), self.slots_per_row)
     pyisc._free_array_int(value_array)
     return self._saved_model
Esempio n. 6
0
 def create_micromodel(self):
     column_array = _to_cpp_array_int(self.column_index)
     self._saved_model = _IscMultiGaussianMicroModel(
         len(self.column_index), column_array)
     pyisc._free_array_int(column_array)
     return self._saved_model
Esempio n. 7
0
 def create_micromodel(self):
     value_array = _to_cpp_array_int(self.value_columns)
     self._saved_model = _IscMarkovGaussMatrixMicroModel(
         value_array, len(self.value_columns), self.slots_per_row)
     pyisc._free_array_int(value_array)
     return self._saved_model