Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions first_attempt_K_means.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 10 17:43:45 2020

@author: Amrit Raj
"""
import numpy as np
Expand Down Expand Up @@ -153,6 +152,23 @@
plt.legend()
plt.show()

#Counting the number of 0's to 3/s....
zero=0
one=0
two=0
three=0

for i in y_kmeans:
if(i==1):
one+=1
elif(i==2):
two+=1
elif(i==3):
three+=1
elif(i==0):
zero+=1

#Hence, these are the number of people in the respective groups

"""
#Visualization.......
Expand All @@ -165,11 +181,6 @@
plt.ylabel('Spending Score----->')
plt.legend()
plt.show()





#Nasha
clist = ['A','G','C','X','N']
for i in range(0, 328):
Expand All @@ -184,7 +195,6 @@

tags = x[4].apply(pd.Series)
tags = tags.rename(columns = lambda a : 'tag_' + str(a))

x = pd.concat([x[:], tags[:]], axis=1)
x=pd.DataFrame(x)
x.rename(columns = {'tag_0':'A'}, inplace = True)
Expand All @@ -204,7 +214,6 @@


"""

#for i in range(5):

#Making the data polynomial...
Expand Down Expand Up @@ -248,7 +257,4 @@
plt.ylabel('RH--->')
plt.show()




"""