0% found this document useful (0 votes)
2 views1 page

K-Means Clustering Assignments Guide

The document outlines an assignment involving K-Means clustering applied to various datasets, including employee salaries, 2D points, income data, student marks, and product sales. It specifies tasks such as reading datasets, applying clustering with specified parameters, and displaying results like cluster centers and group assignments. Additionally, it includes a task to implement K-Means clustering from scratch using a dataset of 2D points.

Uploaded by

Harsh More
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

K-Means Clustering Assignments Guide

The document outlines an assignment involving K-Means clustering applied to various datasets, including employee salaries, 2D points, income data, student marks, and product sales. It specifies tasks such as reading datasets, applying clustering with specified parameters, and displaying results like cluster centers and group assignments. Additionally, it includes a task to implement K-Means clustering from scratch using a dataset of 2D points.

Uploaded by

Harsh More
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment 4

Set A

1. Read the dataset ([Link]) containing employee names and their salaries.
Apply K-Means clustering with k=2 to group employees into Low Salary and High
Salary categories. Display the cluster centers and the group assignment of each
employee.
Input ([Link]):
Name,Salary
John,40000
Alice,35000
Bob,60000
Eve,90000
Sam,80000
2. Given a set of 2D points:
(1,2), (2,3), (3,4), (8,8), (9,9), (10,10)

Apply K-Means clustering with k=2 to divide the points into two groups. Display the
cluster centers and the group assignment of each point.

Set B

Read the dataset ([Link]) with Age and Annual Income. Apply K-Means
clustering with 2 clusters and print the cluster labels for each data point.

Create a dataset of students with Marks in Maths and Science. Use K-Means
clustering (k=3) to group students into performance levels. Print the cluster centers.

Use the dataset ([Link]) with columns Price and Sales. Cluster products into 3
groups (Low, Medium, High selling products). Print cluster centers and plot the result.

Set C

1. Apply K-Means clustering on the Iris dataset (from sklearn).Use features:


SepalLength, SepalWidth, PetalLength, PetalWidth. Cluster into 3 groups. Compare
cluster labels with actual species

2. Implement K-Means clustering from scratch (without using sklearn). Apply it on a


dataset of 2D points

You might also like