Question: For this programming assignment in Python, you don't allow to use sklearn. Read the file from pandas, we are going to implement the k-means clustering

For this programming assignment in Python, you don't allow to use sklearn. Read the file from pandas, we are going to implement the k-means clustering algorithm in Jupyter Notebook. Cluster analysis seeks to separate objects into groups (or clusters), such that the objects within a group are more similar to each other than they are to objects in other groups. For example, we could cluster students by locations of their hometowns, stocks by a list of their closing prices over some interval of time, news articles based on the similarity of the words they contain, or types of cancer based on the profiles of genes that are active.

This problem set studies cluster analysis of data defined by an array of numerical feature values. So a student's hometown location array might just have a latitude and longitude. A stock's array would have a price for each day. For news story aggregation, each article might have the numbers of occurrences of various words. And for the example dataset that we'll actually use here, each patient will be characterized by an array of gene expression levels, indicating for each gene a kind of relative abundance for that patient.

The goal will be to take a set of such samples and find common groups (k of them!).

A sample has a name and an array of values. We will will view each index in the array as a dimension, and will think of an array of n samples as an n-dimensional point. For example, simple.csv:

Sample Feature #1 Feature #2 Feature #3 Feature #4 Feature #5 Features #6 Feature #7 Feature #8 Feature #9 Feature #10
g0 0 0.1 0.2 0 0.4 0.5 0.6 0.7 0.8 0.9
g1 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0 0.1
g2 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
g3 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4
g4 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0
g5 0.5 0 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!