Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Usage example file
  • Loading branch information
pajaskowiak authored Oct 6, 2023
1 parent 8cb89c4 commit 5db8b1c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions aucc_use.py
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'))

0 comments on commit 5db8b1c

Please sign in to comment.