Assignment 5

Modified: 2013/10/12 15:33 by admin - Uncategorized

The Task: Implement a k-Means clustering algorithm

In this task, you are asked to implement a k-Means clustering algorithm.

Your Task:
  • Implement a k-Means clustering algorithm.
  • Report the objective function value (sum of point-to-centroid distances based on Euclidean distance) on the given benchmark datasets with k=5 and k=10, respectively. Since the random initialization of cluster centroids may affect the results, please run the algorithm for 10 times and report the average result.
  • Write a brief report to show your results.

  • Please use this MSWord template to report your results.
  • Do NOT plagiarize, plagiarism will be seriously penalized: You should be careful on writing your report. Whenever you are using words and works of others, citations should be made clear such that one can tell which part is actually yours. Details about how to identify a plagiarism can be found in "Introduction to the Guidelines for Handling Plagiarism Complaints".
  • Do NOT falsify results, data fraud will be even more seriously penalized: You should honestly record your results in the report, NEVER EVER modify the objective value manually.


Benchmark Dataset (UC Irvine Machine Learning Repository)


Programming Language

  • Java / MATLAB
  • We provide the auxiliary codes to load the data and conduct the 10 runs of kmeans so that the only work is to implement the clustering function.


For java

  • Download auxiliary codes. (bug fixed and released at Oct. 12)
  • You need to deal with missing data by yourself. (Double.NaN)
  • You need only to find and accomplish the train method of class Kmeans.
  • You need only to submit


For matlab

  • Download auxiliary codes.
  • You need to deal with missing data by yourself. (NaN)
  • You need only to accomplish myKmeans.m.
  • You need only to submit the myKmeans.m file.



Pack your report and code into a zip file named with your student ID, e.g., ''.

The file format should be zip, no other format is acceptable.
NO submission after the deadline is acceptable!
NO email submission will be accepted!

Upload your file to FTP: (please use FTP software to upload, do not use Windows Explorer or IE)
username: mg_dm13
password: mg_dm13



We will evaluate your submission according to your implementation and report.

For implementation :
  • Efficiency
  • Performance
  • Code style

For report:
Technique: clearly explain all the component you used in your implementation
Language: concise, precise, and logical.

If plagiarism is identified, no scores will be given to this report.


Contact TA

Mr. Sheng-Jun Huang and Mr. Qing Da

Back to assignment homepage
Back to course homepage