def compute_scores(self, dataframe: pd.DataFrame, classes: np.array): if "min_impurity_split" in self.settings: minimum_impurity_split = float(self.settings["min_impurity_split"]) bin_dataframe = dataframe._binarize_categorical_values() self.clf = DCPMetric() self.values = self.clf.countDCP(bin_dataframe, classes, minimum_impurity_split) print("DCP done sucessfully!") return self
class DCP(AbstractDetector): name = "DCP" data_type = "REAL" def compute_scores(self, dataframe: pd.DataFrame, classes: np.array): min_impurity_split = float(self.settings.get("min_impurity_split", 0.5)) bin_dataframe = dataframe._binarize_categorical_values() self.clf = DCPMetric() self.values = self.clf.countDCP(bin_dataframe, classes, min_impurity_split) # print("DCP done sucessfully!") return self