Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Instructor: It wouldn't be data science
if there wasn't this very important topic,
problems with, issues with, or limitations of X.
Well, let's look at the pros and cons of K-means clustering.
The pros are already known to you
even if you don't realize it.
It is simple to understand and fast to cluster.
Moreover, there are many packages that offer it,
so implementation is effortless.
Finally, clustering it always yields a result.
No matter the data, it will always spit out a solution
which is great.
Time for the cons.
We will dig a bit into them
as they are very interesting to explore.
Moreover, this lecture will solidify your understanding
like no other.
The first con is that we need to pick K.
As we already saw, the elbow method fixes that,
but it is not extremely scientific per se.
Second, K-means is sensitive to initialization.
That's a very interesting problem.
Say that these are our points.
If we randomly choose the centroids here and here,
the obvious solution is one top cluster
and one bottom cluster.
However, clustering the points on the left in one cluster
and those on the right in another
is a more appropriate solution.
Now imagine the same situation,
but with much more widely spread points.
Guess what?
Given the same initial seeds,
we get the same clusters because that's how K-means works.
It takes the closest points to the seeds.
So if your initial seeds are problematic,
the whole solution is meaningless.
The remedy is simple. It is called K-means++.
The idea is that a preliminary iterative algorithm is ran
prior to K-means to determine the most appropriate seeds
for the clustering itself.
If we go back to our code,
we will see that sklearn employs K-means++ by default,
so we are safe here,
but if you are using a different package,
remember that initialization matters.
A third major problem
is that K-means is sensitive to outliers.
What does this mean?
Well, if there is a single point
that is too far away from the rest,
it will always be placed in its own one-point cluster.
Have we already experienced that?
Well, of course we have.
Australia was the sole cluster in almost all the solutions
we had for our country clusters example.
It is so far away from the rest of the countries
that it is destined to be in its own cluster.
The remedy, just get rid of outliers prior to clustering.
Alternatively, if you do the clustering
and spot one-point clusters, remove them and cluster again.
A fourth con, K-means produces spherical solutions.
This means that on a 2D plane that we have seen,
we would more often see clusters that look like circles
rather than elliptic shapes.
The reason for that is that we are using Euclidean distance
from the centroid.
This is also why outliers are such a big issue for K-means.
Finally, we have standardization.
Oh, good old standardization.
Let's leave that for the next lesson, shall we?
Thanks for watching.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.