Python Programming for Biology: Bioinformatics and Beyond


Figure 23.6.  Finding the optimum number of clusters for the k-means method



Download 7,75 Mb.
Pdf ko'rish
bet380/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   376   377   378   379   380   381   382   383   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Figure 23.6.  Finding the optimum number of clusters for the k-means method. For a

given data set, the k-means clustering method can be applied to partition the data into

different numbers of clusters. If the number of clusters (k) is not known different numbers

can be tried so that an optimum can be found. A simple way to evaluate the optimum

number of clusters is to measure the relative improvement of the separations of the data

points from their nearest cluster centre. Having more clusters will always give smaller

separations but there will be the most significant change near the optimum number. For

the illustrated example, going from two to three clusters has a bigger jump in minimising

separations than going from three to four clusters. Using four clusters only improves

separations to the centres mildly.

We  can  test  the  jump  method  on  a  simple  normal  data  set  as  before.  The  underlying

clusters are stacked and shuffled randomly and passed in to the function.

data = [random.normal(( 0.0, 0.0), spread, sizeDims),

random.normal(( 1.0, 1.0), spread, sizeDims),

random.normal(( 1.0, 0.0), spread, sizeDims)]



data = vstack(data)

random.shuffle(data)

k = jumpMethodCluster(data, (2, 10), 20)

print('Number of clusters:', k)




Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   376   377   378   379   380   381   382   383   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish