Write some Software

已完成 已发布的 7 年前 货到付款
已完成 货到付款

Your task is to develop a series of functions, some of which we will develop together in class as examples (in python). You must develop each of the requested functions (that is, you can't change the structure of the application -- each of the requested functions must exist in the program you turn in, and each must work as requested). Here are the requirements for each:

euclidean_dist: Takes two tuples of floating-point values as input (equal length) and determines the euclidean distance between them. Simple enough :)

assign_initial_centroids: This function will have 2 parameters, k and data, where k is the number of centroids and data is a list of input tuples (data points, all floating point values). You may implement this any way you wish, as long as it returns a list of tuples with the appropriate length (the same number of floating point attributes as in the data set). Experiment!

assign_tuples_to_clusters: This function will take a list of tuples representing the centroids and a list of tuples representing the original dataset. It will assign each data point in the data set to a cluster corresponding to one of the centroids (the closest centroid, according to the euclidean distance function). In the case of a tie, choose the first centroid in the list. It should return a list of lists of tuples, where each "sub list" represents a single cluster. Order is not important, but it may be helpful for you to maintain the same order as the clusters came in for debugging purposes.

derive_centroids_for_clusters: This function should simply take a list of lists of tuples representing the clustered input data, as returned by assign_tuples_to_clusters. There should be k lists (clusters) in this input so this function should find a centroid for each list (as a tuple) and return a list of the centroids. The centroids should have averaged values for each attribute of each tuple in a single cluster.

kmeans_cluster: This function should take an integer (k -- the number of clusters/centroids) and a list of tuples (the initial dataset). It should first call assign_initial_centroids to determine the initial set of k centroids to work with and print the results. It should then enter a loop in which it computes new clusters for these centroids (and prints the results) and then computers new centroids for the new clusters (and prints the results). It should terminate when the computed centroids do not change from the prior iteration.

Once each of these functions are written, you should develop a script that reads in a file named [login to view URL] from the local folder which holds the input tuples in csv format (no spaces will be included, for simplicity). You should hardcode k and process this file using the kmeans algorithm, printing the resulting clusters.

Python 软件构架

项目ID: #12152094

关于项目

6个方案 远程项目 活跃的7 年前

授予:

iyersume

Hi, I am proficient in Python, Machine Learning and Data Science. I would like an opportunity to work with you on this project. Please feel free to ping me on chat. My bid is an estimate and may change based on scope o 更多

$35 USD 在3天内
(35条评论)
5.3

有6名威客正在参与此工作的竞标,均价$74/小时

AdeelAslam4

Hi there! I have read what you exactly need, however I would like to ask you a few questions. I wouldn't call myself a master but I do work smart and do not rest until I get the job done. Please feel free to ping me an 更多

$111 USD 在3天内
(17条评论)
6.2
zkutch

Hello. More 20 years programming experience. I need more details to set real time and price. Regards. -------------------------------------------------------------------------------------------------------------- 更多

$25USD 在1天里
(18条评论)
4.6
marcnabillabib

I am an embedded systems engineer , and I learned Python and creating functions is a fairly easy subject , so this project shouldn't be any problem. Feel free to contact me if you have any questions.

$30 USD 在2天内
(5条评论)
3.2