def compute_scores(self, dataframe: pd.DataFrame, classes: np.array): if "n_neighbors" in self.settings: k = int(self.settings["n_neighbors"]) bin_dataframe = dataframe._binarize_categorical_values() self.clf = KDNMetric() self.values = self.clf.countKDN(bin_dataframe, classes, k) print("KDN done sucessfully!") return self
class KDN(AbstractDetector): name = "KDN" data_type = "REAL" def compute_scores(self, dataframe: pd.DataFrame, classes: np.array): if "n_neighbors" in self.settings: k = int(self.settings["n_neighbors"]) else: k = 10 bin_dataframe = dataframe._binarize_categorical_values() self.clf = KDNMetric() self.values = self.clf.countKDN(bin_dataframe, classes, k) # print("KDN done sucessfully!") return self