Beispiel #1
0
    def plot(self, X=None, palette='Set2'):
        if X is None:
            X = self.X

        labels = self.labels

        _scatter_clusters_outliers(_store_X(X, True), labels, palette)
Beispiel #2
0
    def plot(self, X='None', palette='Set2'):

        if X is None:
            X = self.X

        labels = self.labels
        factor = self.negative_outlier_factor
        _scatter_clusters_outliers_local(_store_X(X, True), labels, factor,
                                         False, palette)
Beispiel #3
0
 def __init__(self, obj, X, labels_true=None, store_X=False, digits=3):
     self.model = obj
     self.labels = obj.predict(X)
     self.n_clusters = np.unique(self.labels)
     self.variables = obj.n_features_in_
     self.SIL, self.DB, self.CH = _clustering_metrics(
         self.labels, X, digits)
     self.centers = _clust_centers_X(X, self.labels)
     self.labels_names = np.unique(self.labels)
     self.cluster_size, self.cluster_weights = _clust_weight(self.labels)
     self.ARI, self.FM = _clustering_evaluation(self.labels, labels_true,
                                                digits)
     self.X = _store_X(X, store_X)
     self.n_estimators = obj.n_estimators
     self.base_estimator = obj.base_estimator_
     self.max_features = obj.max_features
     self.bootstrap = obj.bootstrap
     self.contamination = obj.offset_
     self.max_samples = obj.max_samples
Beispiel #4
0
 def __init__(self, obj, X, labels_true=None, store_X=False, digits=3):
     self.model = obj
     self.labels = obj.predict(X)
     self.n_clusters = np.unique(self.labels)
     self.variables = obj.n_features_in_
     self.SIL, self.DB, self.CH = _clustering_metrics(
         self.labels, X, digits)
     self.centers = _clust_centers_X(X, self.labels)
     self.labels_names = np.unique(self.labels)
     self.cluster_size, self.cluster_weights = _clust_weight(self.labels)
     self.ARI, self.FM = _clustering_evaluation(self.labels, labels_true,
                                                digits)
     self.X = _store_X(X, store_X)
     self.C = obj.C
     self.kernel = obj.kernel
     self.degree = obj.degree
     self.gamma = obj.gamma
     self.shrinking = obj.shrinking
     self.support_vectors_ = pd.DataFrame(obj.support_vectors_)
     self.n_support = pd.DataFrame(obj.n_support_)
Beispiel #5
0
 def __init__(self, obj, X, labels_true=None, store_X=False, digits=3):
     self.model = obj
     self.labels = obj.fit_predict(X)
     self.n_clusters = np.unique(self.labels)
     self.variables = obj.n_features_in_
     self.SIL, self.DB, self.CH = _clustering_metrics(
         self.labels, X, digits)
     self.centers = _clust_centers_X(X, self.labels)
     self.labels_names = np.unique(self.labels)
     self.cluster_size, self.cluster_weights = _clust_weight(self.labels)
     self.ARI, self.FM = _clustering_evaluation(self.labels, labels_true,
                                                digits)
     self.X = _store_X(X, store_X)
     self.labels_true = labels_true
     self.n_neighbors = obj.n_neighbors_
     self.radius = obj.radius
     self.metric = obj.effective_metric_
     self.p = obj.p
     self.fit_method = obj._fit_method
     self.leaf_size = obj.leaf_size
     self.contamination = obj.offset_
     self.novelty = obj.novelty
     self.negative_outlier_factor = pd.Series(obj.negative_outlier_factor_)