Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele K-Means Model with 4 Clusters | Clustering
Clustering Demystified

book
K-Means Model with 4 Clusters

Let's try to improve clustering results using the split on 4 separate clusters.

Tehtävä

Swipe to start coding

  1. Evaluate the KMeans with 4 clusters.
  2. Fit the algorithm.

Ratkaisu

kmeans = KMeans(n_clusters=4, random_state=0)

kmeans.fit(X)

# check how many of the samples were correctly labeled
labels = kmeans.labels_

correct_labels = sum(y == labels)
print("Result: %d out of %d samples were correctly labeled." % (correct_labels, y.size))
print("Accuracy score: {0:0.2f}". format(correct_labels/float(y.size)))

Congratulations on completing the Clustering Project!

Mark tasks as Completed
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 11

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

some-alt