Question: [ 1 0 points ] Problem 1 - K Means Clustering In [ 4 1 ] : def k _ means _ clustering ( centroids
points Problem K Means Clustering In : def kmeansclusteringcentroids dataset:
# Description: Perform means clustering for iterations given as input the dataset and centroids.
# Input:
# centroids A list of lists containing the initial centroids for each cluster.
# dataset A list of lists denoting points in the space.
# Output:
# results A dictionary where the key is iteration number and store the cluster assignments i
# appropriate clusters. Also, update the centroids list after each iteration.
result
: 'cluster: 'cluster: 'cluster: 'centroids':
: 'cluster: 'cluster: 'cluster: 'centroids':
centroid centroid centroid centroids centroids centroids
for iteration in range:
# your code here
return result
A sample dataset has been provided to you in the datasampledatasetkmeans.pickle' path. The centroids are in datasamplecentroidskmeans.pickle'
and the sample result is in datasampleresultkmeans.pickle' path. You can use these to test your code.
Here are the attributes for the dataset. Use this dataset to test your functions.
Dataset should load the points in the form of a list of lists where each list item represents a point in the space.
An example dataset will have the following structure. If there are points in the dataset, this would appear as follows in the list of lists.
dataset
Note:
A sample dataset to test your code has been provided in the location "datasampledatasetkmeans.pickle". Please maintain this as it would be necessary
while grading.
Do not change the variable names of the returned values.
After calculating each of those values, assign them to the corresponding value that is being returned.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
