-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from sklearn import metrics | ||
from sklearn.metrics import pairwise_distances | ||
from sklearn import datasets | ||
from sklearn.cluster import KMeans | ||
|
||
import numpy as np | ||
|
||
from aucc import aucc | ||
|
||
# As usage example, we use the same code employed for Silhouette in scikit-learn | ||
# available at: https://scikit-learn.org/stable/modules/clustering.html#silhouette-coefficient | ||
|
||
X, y = datasets.load_iris(return_X_y=True) | ||
kmeans_model = KMeans(n_clusters=3, random_state=1, n_init='auto').fit(X) | ||
labels = kmeans_model.labels_ | ||
print(aucc(X, labels, metric='euclidean')) |