Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Corporate Finance

Authors: Stephen Ross, Randolph Westerfield, Jeffrey Jaffe

10th edition

978-0077511388, 78034779, 9780077511340, 77511387, 9780078034770, 77511344, 978-0077861759

More Books

Students also viewed these Programming questions

Question

Define the three forms of market efficiency.

Answered: 1 week ago

Question

Explain how the sense of smell works.

Answered: 1 week ago