Question
For this assignment, you are implementing the k -Meansclustering algorithm in python. The command to run the algorithmshould be as follows: ./yourprog values.txt k where
For this assignment, you are implementing the k-Meansclustering algorithm in python. The command to run the algorithmshould be as follows:
./yourprog values.txt k
where values.txt is a space-separated file which contains a setof 2D objects with numeric attributes and k is the numberof clusters you wish to find.
For example:
values.txt
12 32
43 25
178 234
32 49
156 200
values-output.txt
12 32 0
43 25 0
178 234 1
32 49 0
156 200 1
The output should be a space separated text file with the thirdcolumn having the discovered cluster index for each data object.There should be no output to console.
Please do not import a library which already hask-Means implemented. This has happened in thepast by students using scikit.learn and finding thek-Means implementation in there. The objective of thisassignment is to get practice on the machinery of k-Meansand have some programming practice in the process; not to analyzedata.
Edit : code should be in python for k-meanclustering algorithm. Cant use libraries like scikit.learn
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started