Question: Task 2 The dataset we are going to use has 1 0 0 0 entries with unknown number of clusters ( download data _ Kclusters.txt

Task 2
The dataset we are going to use has 1000 entries with unknown number of clusters (download
data_Kclusters.txt from Blackboard). Use the Elbow Method to find the optimum value for K and show
the results for clustering using the optimum k. You can use the following lines to plot the elbow.
Page 4 of 5
WCSS =[]
K= range (1,10)
for this_k in K:
kmeanModel = KMeans (n_clusters = this_k)
kmeanModel.fit (X)
WCSS.append (kmeanModel.inertia_)
# Plot the elbow
plt.figure()
plt.plot(K, wCSS,'bx-')
plt.xlabel('k')
plt.ylabel('WCSS')
plt.title('The Elbow Method showing the optimal k')
 Task 2 The dataset we are going to use has 1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!