Summarizing the algorithm for K Means clustering based on this video: 1. Start with k centroids by putting them at random points here k =2 2. Compute distance of every point from centroid and cluster them accordingly 3. Adjust centroid so they become center of gravity of given cluster 4. Again recluster every point based on distance with adjusted centroid 5. Reiterate until data points stop changing cluster 6. Again adjust centroids
Please correct me if I am wrong - 2. Compute distance of every point from centroid and cluster them accordingly - This entire process is "built" inside the KMeans.fit_predict(). Correct ?
You make Machine Learning so easy to understand. I would say you are a SAVER for the people who are struggling to understand different ML algorithums. Thank you so much. please if possible put some content on NLP.
It's a blessing to be able to finally say that I can learn ML, thanks to you :). I have used 'HUE' from seaborn instead of writing plt.scatter for every group of the cluster. sns.scatterplot(df['Age'], df['Income($)'], hue = df['Cluster'])
Fantastic explanation. I like the way you showed us what happens if you don’t scale your features. You also waited for the perfect opportunity to show why we need to use the elbow method.
Thanks for your feedback kin. 👍😊 Feedback like this helps me continue do the good things and also any critical feedback is welcome as well as it helps me improve 👍
What a beautiful explanation. The beauty of Data Science is shown in this video in a remarkable way. The exercise is really beautiful! Thank you very much, Sir.
Excellent tutorial. This is highly recommended to watch. Thanks a lot Sir, I find it helpful in my project work....I really appreciate. You have done great work to help others. Keep up doing this great work.
This was awesome! I can't believe I learned how to do K-means clustering in just a few hours. Your explanations are clear and concise. Thank you so much!
All ML series Iam following, Iam following to your vedios nicely explained you explaination ans approach is awasome now I stopped seeing all news social media network just following up your vedios only.....your vedios has magentic power........................
You make every topic so easy to understand. Long time no video, we miss your videos. Please upload video regularly. Once again good to see your videos. Thank u
Panda, thanks for your appreciation. I am going through some health issues and that's the reason not able to upload the content on regular basis. I will start uploading once I recover... 🙂
@@codebasics oh sorry i m not aware of it.Its ok. Take your time and concentrate on full health recovery . Get well soon sir. Take care. Once again thank u for everything 😊
Fantastic coverage...you covered the basics, then talked about the reasons and potential challenge with real-world data, and showed some amazing methods to visualize differently. Thank you for your continued contribution to learning and sharing with the community. This kind of tutorials is what will make newcomers gravitate toward ML and be glad to learn.
@@codebasics Absolutely. I do have a follow-up question. I got lost after scaling the values...let me explain. I have a dataset of tips($) and total restaurant bill($) per day per group of customers. I got 3 clusters and they look good after rescaling the bill and tips via MinMax (my x-axis is the bill for food, and y-axis is tips $). But after clustering, I can't tell how to map the x-axis and y-axis rescaled values (which are 0..1 floats) to actual dollar values that are in the dataset. I need to know how the clusters map to real dataset. Is there a way to do that logically? Would really appreciate your input. TY!
Going to university, studying, learning, reading from books And then you find some random guy form (I assume India) who exlans it in simple way.in less than 30 minutes... Respect!
man you shouldn't have put these playlists on youtube for free... these are gems... people should pay to learn these gems for at least some small amount.. You are awesome sir ... The things which I wasn't able to learn you taught me in that... hats off sir... hope we will meet one day
Thank you so so much for making Machine learning so easy to understand by the series sir. The more i look for any ML content of yours, the more i wish to go on for the entire series with such clear understanding. with passion for the subject & curiosity to search had been gone through so many tutorials so far but codebasics is the best learning source for beginners like me and would definitely recommend this to freshers/ beginners for a clear base understanding for data science.... MUCH APPRECIATE
Thanks Pooja for your kind words. This means a lot to me and gives me a fuel to continue my work. If you like my videos would you share this series and deep learning series on your facebook page, linked in or watsapp? That way maximum people can benefit from it.
Amazed!!! Understood the concept in just one go! Hands on is by far the best I ever saw.. Keep up the good work Sir, please post more videos majorly used algorithms. Thank you.
Thanks a ton... I love your simplicity in explanation and perfection in explaining hurdles that everyone might face. Please keep doing this great work.
Really useful videos .. i got too many doubts in machine learning.. came up with one video became a subscriber now .. thanks brother for clear explanation
not sure if anyone else had this problem but at 16:00, i had to add an extra set of brackets when i did this exercise. maybe my python is outdated or something. scaler = MinMaxScaler() scaler.fit(df[['Income($)']]) df['Income($)'] = scaler.transform(df[['Income($)']]) df
Kin, what you are doing is correct. In tutorial I got warning but ignored it but yea it takes 2D array as input. Here is my correct code: github.com/codebasics/py/blob/master/ML/13_kmeans/13_kmeans_tutorial.ipynb
Another excellent video Sir, it is difficult to wait to see your videos on Neural Networks...as you mentioned in the comments below. thanks a ton for your efforts
Exercise done. viewing the initial plot n_clusters seems equal to 2, bt using ellbow method clears it to use n_clusters =3,,,,,Enjoying this holiday!!!!!!!!!!
How will I forget to give a thumbs up?🤣😂.The video was sooo useful and very simple but effective.I understood k-means clustering and Elbow methods.Thank you for posting such a useful video.
Hi Dhaval ji - excellent video on KMC. Very precise in presenting, Particularly liked the cluster_centers_ and inertia_ concepts. The final elbow plot with for loop being the starting point was unparalleled in clarity. Thanks a lot
Sir , I found your channel just a week ago and i would just like to thank you so much for such a wonderful content ! Please continue the ML series .. I hope you also make tutorial of Neural Networks and their application!
Awesome explanation from you sir,I think this is best tutorial for k means clusters in the youtube . I tried seen lot of videos in the RUclips regrading on the this topic . But this video give me some boost to create the amazing the model in ml tq for all this sir . My feedback is : you shoud give the some more example on topics that will be help to us to make beautiful things from this
@@paulcurious2324 @Paul Curious hi, if you have 3 atributes.. For example: color, leaf type and flower. You need make a code using 3 separated arrays.. Inside df( [ [ 'color','green'] ],[ [ 'Leaf','small'] ] ,[ ['flower','white']] )
This was brilliant and I appreciate the explanation of the code. Question, once you get the clusters identified as you took age and income, what would you explain? Would you need the table as well to discuss the pattern as a supplement as otherwise we would just say we have three clusters, but what do they mean?
Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced
why do we not need to use centroids for the iris dataset?
Summarizing the algorithm for K Means clustering based on this video:
1. Start with k centroids by putting them at random points here k =2
2. Compute distance of every point from centroid and cluster them accordingly
3. Adjust centroid so they become center of gravity of given cluster
4. Again recluster every point based on distance with adjusted centroid
5. Reiterate until data points stop changing cluster
6. Again adjust centroids
Noted!
7. done and put the ruler away
Please correct me if I am wrong -
2. Compute distance of every point from centroid and cluster them accordingly - This entire process is "built" inside the KMeans.fit_predict(). Correct ?
its easy to undersytand theory implementations trickyu
You are probably one of the best teachers I have come across. Thank you so much!
You make Machine Learning so easy to understand. I would say you are a SAVER for the people who are struggling to understand different ML algorithums. Thank you so much. please if possible put some content on NLP.
my grad school professor explains this very badly. You explain things very well with patience, you are the definition of a good teacher
glad you liked it :)
It's a blessing to be able to finally say that I can learn ML, thanks to you :). I have used 'HUE' from seaborn instead of writing plt.scatter for every group of the cluster. sns.scatterplot(df['Age'], df['Income($)'], hue = df['Cluster'])
Thanks for this 👍
Yes, with seaborn you can do it in one line. Thanks for posting this comment 🙏🏼🙏🏼
I have started loving machine learning due to the simplicity of explanations.
you can't find a video and not watch all playlists , im so grateful to you , thank you sir!
All the ML series is so exciting. I'm learning and having fun during the quarantine in Brazil, SP.
Thanks, @codebasics
Fantastic explanation. I like the way you showed us what happens if you don’t scale your features. You also waited for the perfect opportunity to show why we need to use the elbow method.
Thanks for your feedback kin. 👍😊 Feedback like this helps me continue do the good things and also any critical feedback is welcome as well as it helps me improve 👍
I looked 5 min at start, and your teaching style for ML is spot on, better than the IIT professors. I am enjoying ML algo now. Thanks.
What a beautiful explanation. The beauty of Data Science is shown in this video in a remarkable way.
The exercise is really beautiful!
Thank you very much, Sir.
Dear Nilpul, Thanks for the comment. Keep learning. 😂
Excellent tutorial. This is highly recommended to watch. Thanks a lot Sir, I find it helpful in my project work....I really appreciate. You have done great work to help others. Keep up doing this great work.
was trying out tons of videos trying to understand the basics of ML, you made it so simple and quick.
Loved it!!
😊👍
Dear CodeBasics, your tutorials are way better than all the classes of the Master in AI I have just completed. Thank you very much!
Glad it helped you 😊
I searched for 3-4 days and I only got the plotting after seeing your video- Thanks a lot
This is a great quick refresher for those with the basic knowledge of ML clustering algorithms
This was awesome! I can't believe I learned how to do K-means clustering in just a few hours. Your explanations are clear and concise. Thank you so much!
Glad it was helpful!
Sir, you made Machine Learners life easy....amazing explanation that ever seen before and by Elbow technique we got K=3 for iris dateset.
Thanks for you kind words and I am happy you liked it 😊
@@codebasics Sir can you please make one video on knn algorithm? I need it so badly. Thankyou
I have got the real clarity after watching your video, This is a great help. Thank you for all the videos.
I must say!! you are making life alot easier for all of us!!! Thanks a lot mannn.. Your efforts are really appreciated. Keep up hard work.
All ML series Iam following, Iam following to your vedios nicely explained you explaination ans approach is awasome now I stopped seeing all news social media network just following up your vedios only.....your vedios has magentic power........................
Excellent quick and short explanation of K-means. Appreciate it
Glad it was helpful!
It was good, simple, informative, no errors. I guess these are enough clusters to define the quality of this video.
You make every topic so easy to understand. Long time no video, we miss your videos. Please upload video regularly. Once again good to see your videos. Thank u
Panda, thanks for your appreciation. I am going through some health issues and that's the reason not able to upload the content on regular basis. I will start uploading once I recover... 🙂
@@codebasics oh sorry i m not aware of it.Its ok. Take your time and concentrate on full health recovery . Get well soon sir. Take care. Once again thank u for everything 😊
This is the best-explained K-means on the internet - period. Thank you!
Glad it was helpful!
Really it is invaluable and unconditional service
really liking the course i cant believe i already watched more than 50 videos from a playlist only 50 more to go
One of the most useful tutorial I have ever seen
🤓👍
7:25 Brilliant Explaination!
The best ML lesson I've ever heard
your explanation is clear and clarity in the content.. and knowledge sharing to needed Data Science community is Nobel... thankyou... 🙏
These videos are more helpful than all of the classes I took in my university combined.
I am happy this was helpful to you.
Fantastic coverage...you covered the basics, then talked about the reasons and potential challenge with real-world data, and showed some amazing methods to visualize differently. Thank you for your continued contribution to learning and sharing with the community. This kind of tutorials is what will make newcomers gravitate toward ML and be glad to learn.
Glad you enjoyed it!
@@codebasics Absolutely. I do have a follow-up question. I got lost after scaling the values...let me explain. I have a dataset of tips($) and total restaurant bill($) per day per group of customers. I got 3 clusters and they look good after rescaling the bill and tips via MinMax (my x-axis is the bill for food, and y-axis is tips $). But after clustering, I can't tell how to map the x-axis and y-axis rescaled values (which are 0..1 floats) to actual dollar values that are in the dataset. I need to know how the clusters map to real dataset. Is there a way to do that logically? Would really appreciate your input. TY!
the way yoy explain is commendable making it so easy even fote beginners....thankyou so much for your efforts sir..really
👍😊🙏
Thanks a lot for the video. You taught the K-Means Clustering
in 10 mins!
👍☺️
This is best video of all ml videos on youtube
Oh man just wow wow wow. You made my day what a lesson it was. Absolutely you nailed it
Outstanding explanation my friend !! Thank you from Houston
👍👍😇
Nice way of explaining the complicated concept with an example. Great Job !!! Thanks a lot
sir bas aap please video upload karte rehna . aapki videos se bahut help milti hai
Sure pulkit. Me koshish yahi karunga ke jyada se jyada achhe video produce karta rahu on machine learning.
Thanks
Saw so many videos, but this one video helped the most. Thanks!
Glad it helped!
Optimal value for iris data set got 3. Thank you very much for simple & great explanation.
Going to university, studying, learning, reading from books
And then you find some random guy form (I assume India) who exlans it in simple way.in less than 30 minutes... Respect!
I am glad Igor that this was helpful to you 😊👍
this is a perfect introduction to k-means thank you for making this video👌
Glad you liked it!
You are awesome, you make the complex things simplified.Please keep up the good work.
Thanks, will do!
Best channel for explanations on ML algorithms. Thank you so much :) , definitely subscribed .
Thanks and welcome
You are awesome. You made me think ML is not complex to learn.
Indeed, ML is not as complex as people think it is !
codebasics thank you. Post more videos your way to explaining things well understood.
Thanks so much for your easy-to-understand tutorials. You are a blessing. God bless you!
man you shouldn't have put these playlists on youtube for free... these are gems... people should pay to learn these gems for at least some small amount.. You are awesome sir ... The things which I wasn't able to learn you taught me in that... hats off sir... hope we will meet one day
Thanks for your appreciation, sure when I am in India I will plan for a Meetup
great explanation taking from a small example and going in elaborative way covering whole concept in a nutshell very well explained
Amazing video. Creative, resourceful and excellent preparation. Keep posting more such videos.
Amazing video and explanantion! Just started learning about Machine Learning algorithms and this is incredibly helpful. Thank you!
Wow, great intro to cluster analysis in Python. Thank you so much, awesome teaching as always!
Glad it was helpful!
Thank you so much Dhaval for this video, with my elbow technique I got k=3.
Thanks
You are really good! I would be happy to pay for such clear code lectures. Very well articulated! Keep it up!
Suigeneris44, I appreciate your comment buddy. I am glad you found this to be useful :)
God bless you. You are ML Guru! I love your content. very easy to understand the basics of everything.
Thank you so so much for making Machine learning so easy to understand by the series sir. The more i look for any ML content of yours, the more i wish to go on for the entire series with such clear understanding. with passion for the subject & curiosity to search had been gone through so many tutorials so far but codebasics is the best learning source for beginners like me and would definitely recommend this to freshers/ beginners for a clear base understanding for data science.... MUCH APPRECIATE
Thanks Pooja for your kind words. This means a lot to me and gives me a fuel to continue my work. If you like my videos would you share this series and deep learning series on your facebook page, linked in or watsapp? That way maximum people can benefit from it.
@@codebasics Thanks for your efforts! Stay blessed...
huge respect to your hardwork , vedios increasing learning curiosity 👏👏👏👏
Wow. You are a great man. You've made it soo simple to understand. Thank you Sir. 🔥🔥🔥
Glad you enjoyed it
Thank you! really enjoyed this session. I tried both Petal and Sepal and it went very well.
Glad you enjoyed it!
All your videos are clear and good. Congrats for that. Can you please make a video for recommender systems and NLP
Thanks thirugnanam, point noted!
been researching about these regressions and other methods, have always found myself in your vids, you sir earned my sub :)
Amazed!!! Understood the concept in just one go! Hands on is by far the best I ever saw.. Keep up the good work Sir, please post more videos majorly used algorithms. Thank you.
Thanks a ton... I love your simplicity in explanation and perfection in explaining hurdles that everyone might face. Please keep doing this great work.
Make Machine Learning so easy to understand. Thx
Really useful videos .. i got too many doubts in machine learning.. came up with one video became a subscriber now .. thanks brother for clear explanation
Thanks a lot for the tutorial video, @codebasics. You are an excellent teacher.
You make things quite simple. Please keep posting..
not sure if anyone else had this problem but at 16:00, i had to add an extra set of brackets when i did this exercise. maybe my python is outdated or something.
scaler = MinMaxScaler()
scaler.fit(df[['Income($)']])
df['Income($)'] = scaler.transform(df[['Income($)']])
df
Kin, what you are doing is correct. In tutorial I got warning but ignored it but yea it takes 2D array as input. Here is my correct code: github.com/codebasics/py/blob/master/ML/13_kmeans/13_kmeans_tutorial.ipynb
Kin Cheng thank you so much
Wow..
What a nice explanation!
Thank you for such a nice video
you are very strong .thank you so much for making this class easy
Another excellent video Sir, it is difficult to wait to see your videos on Neural Networks...as you mentioned in the comments below. thanks a ton for your efforts
Exercise done. viewing the initial plot n_clusters seems equal to 2, bt using ellbow method clears it to use n_clusters =3,,,,,Enjoying this holiday!!!!!!!!!!
thank you so much !
congrats for 100K !!
How will I forget to give a thumbs up?🤣😂.The video was sooo useful and very simple but effective.I understood k-means clustering and Elbow methods.Thank you for posting such a useful video.
You are awesome man, thanks a lot. Keep on sharing your significant educative videos, please.
best tutorials for Machine learning
The way explained, it really understandable... Keep uploading more n more videos on ML .. with Case Study .. Thanks in Advance
Thank you, I will
Hi Dhaval ji - excellent video on KMC. Very precise in presenting, Particularly liked the cluster_centers_ and inertia_ concepts. The final elbow plot with for loop being the starting point was unparalleled in clarity. Thanks a lot
Thanks a ton
Excellent, amazing . You make it so easy. Thank you sir
I love how you explained the material in plain language. You made it very easy to follow and understand ❤
Very clean explanatıons. Thank you. You should be more visible on RUclips!
Fantastic tutorial !!! .Thanks a lot sir ... It gives best explanation
Beautiful! Superbly explained!
Glad you liked it!
sir in exercise portion..is any type of scaling required?
Sir , I found your channel just a week ago and i would just like to thank you so much for such a wonderful content ! Please continue the ML series .. I hope you also make tutorial of Neural Networks and their application!
Awesome explanation from you sir,I think this is best tutorial for k means clusters in the youtube . I tried seen lot of videos in the RUclips regrading on the this topic . But this video give me some boost to create the amazing the model in ml tq for all this sir .
My feedback is : you shoud give the some more example on topics that will be help to us to make beautiful things from this
Really must appreciate the playlist 😌
Superb explanation but I feel elbow plot is to be drawn initially so it is more clear about K
Thank you so much for such well explained tutorials.
The best explanation ever... Thank you so much
Very clearly explained video! Thank u very much!
you are amazing, I like your simplicity in delivering the information, thank you very much
Glad it was helpful!
If you have more than 2 atributes use.. df([[ 'name', 'example]] >X ,[[ 'name', 'example]] >Y )
i dont get this please could you explain in detail
@@paulcurious2324 @Paul Curious hi, if you have 3 atributes.. For example: color, leaf type and flower. You need make a code using 3 separated arrays.. Inside df( [ [ 'color','green'] ],[ [ 'Leaf','small'] ] ,[ ['flower','white']] )
@@R3NAN3224 it says df is not a callable when i do that
@@R3NAN3224 can u send a link to an example, maybe github or repl
@@paulcurious2324 see in 8:00 ... df is a name associate of your database. Paste your code here to i see you database name.
Very Very Good tutorial! You have explained each and every concept very nicely. Thank you so much😌😌😌
Glad it was helpful!
very nice video sir and easy to understand.. thank you and more power!
You are most welcome
What a fantastic way to expain this algorithm ? What are the practical usecases of this algo ?
Great video. I am still learning and found this very helpful.
Glad it was helpful!
This was brilliant and I appreciate the explanation of the code.
Question, once you get the clusters identified as you took age and income, what would you explain?
Would you need the table as well to discuss the pattern as a supplement as otherwise we would just say we have three clusters, but what do they mean?