How to implement KNN from scratch with Python

  Рет қаралды 96,289

AssemblyAI

AssemblyAI

Күн бұрын

Пікірлер: 68
@afizs
@afizs 2 жыл бұрын
Short and simple. I like the way you explained the KNN in simple words.
@AssemblyAI
@AssemblyAI 2 жыл бұрын
Thank you!
@nizamuddinshaikh3185
@nizamuddinshaikh3185 Жыл бұрын
Implementing KNN is so easy? That was my first thought after I saw this video. Really the way, it is explained and shown here is remarkable. It not only shows KKN but also how powerful is plain Python when used sensibly with library like Numpy. The entire idea is very useful for beginners like me. I am now AssemlyAI subscriber. I am going to not only see but follow along all videos of this playlist in order to get better understanding of Python, Numpy, Pandas and DataScience. Thank you AssemblyAI for sharing.
@Brandonator24
@Brandonator24 Ай бұрын
fun fact, for the distance between points in KNN, you can omit the square root portion of the euclidean distance function for efficiency. Square root function is monotonic, so it if a < b then sqrt(a) is also < sqrt(b).
@l4dybu9
@l4dybu9 2 жыл бұрын
This is the best series to learn ML. 🎓🔥🔥 Imma recommend it to all my ml enthusiast friends ✌🏻
@AssemblyAI
@AssemblyAI 2 жыл бұрын
Thank you!
@johanriedel
@johanriedel 2 жыл бұрын
The free course is appreciated, but I have trouble understanding some of the terms and the thoughts behind certain functions.
@mbmathematicsacademic7038
@mbmathematicsacademic7038 6 ай бұрын
short and simple ,no complications
@bakhtiarrasheed9952
@bakhtiarrasheed9952 2 жыл бұрын
Great tutorial, I also added tie-breaking functionality in case tie occurs in most frequent label.
@philtrem
@philtrem Жыл бұрын
Very easy to follow after I created my own implementation. Very similar to my own implementation, except I elected to use a priority queue to keep track of the k nearest, instead of sort (because having to keep track of indices was a pain, and it was getting late). Coded mine in C# without third party libraries. I like that numpy offers a argsort method here, comes in handy.
@semrana1986
@semrana1986 4 ай бұрын
wonderfully done with a lot of clarity
@OmarAmil
@OmarAmil Жыл бұрын
Short and simple, Thank you very much
@AssemblyAI
@AssemblyAI Жыл бұрын
You're very welcome!
@emir5146
@emir5146 9 ай бұрын
I don't understand that why we add terms that '[0][0]' to the list of most_commons? 8:04
@stanvanillo9831
@stanvanillo9831 9 ай бұрын
The counter returns the sorted count of all possible outcomes, i.e. a list of tuples and each tuples has the label and the count, (label, count). You only want the most common one, i.e. the first element in the array and you only want the label, not the count, i.e. you want the first element of that tuple which is also accessed by using [0]. Therefore you need to apply [0][0].
@Franshpsv
@Franshpsv 11 ай бұрын
I like to follow this course from Lesson 1, what is the link that i need to start here?
@IgorKuts
@IgorKuts Жыл бұрын
Nice and concise. Love it.
@takasurazeem
@takasurazeem Жыл бұрын
How can I plot the graph again to see if it turned those blues into the green?
@youssefelamrani7905
@youssefelamrani7905 2 жыл бұрын
good job, I like it, KNN doesn't well with images i believe right?
@cherpysara
@cherpysara 10 ай бұрын
I am getting error no module NAMED KNN .... pl help to resolve this problem.
@luis96xd
@luis96xd 2 жыл бұрын
Whoa, excellent video! It was well explained, thanks! 😁😁👍🤩
@AssemblyAI
@AssemblyAI 2 жыл бұрын
You're very welcome :)
@mrarsenal10vn
@mrarsenal10vn Жыл бұрын
I love this tutorial so much
@AssemblyAI
@AssemblyAI Жыл бұрын
Awesome!
@alexandergarzo9415
@alexandergarzo9415 2 жыл бұрын
Please explain in more detail every line code.
@andrea-mj9ce
@andrea-mj9ce 2 жыл бұрын
What about the regression case?
@KarthickKenny.
@KarthickKenny. Жыл бұрын
There is no regression in knn it is a classification algorithm
@andrea-mj9ce
@andrea-mj9ce Жыл бұрын
@KarthickKenny. One can apply KNN when the response variable is continuous
@KarthickKenny.
@KarthickKenny. Жыл бұрын
@@andrea-mj9ce you have to apply regression algorithm in that case not knn
@emir5146
@emir5146 9 ай бұрын
Thank you abla
@sedwares
@sedwares Жыл бұрын
Great video!
@AssemblyAI
@AssemblyAI Жыл бұрын
Glad you enjoyed it
@imadsaddik
@imadsaddik Жыл бұрын
Thank you for sharing
@AssemblyAI
@AssemblyAI Жыл бұрын
Thanks for watching!
@derickkwame6148
@derickkwame6148 Жыл бұрын
great simple tutorial but how do i plot a graph with the knn?
@ge_song5
@ge_song5 4 ай бұрын
wow, she knows her stuff.
@tejasrathi635
@tejasrathi635 9 ай бұрын
How did you visualised the data ?
@youssefzaim7163
@youssefzaim7163 Жыл бұрын
great excahnge ndiro niya
@esmailsayid2976
@esmailsayid2976 Жыл бұрын
amazing job
@urielcalderon1661
@urielcalderon1661 2 жыл бұрын
Thank you
@AssemblyAI
@AssemblyAI 2 жыл бұрын
You're very welcome :)
@SantiagoGomezVideos
@SantiagoGomezVideos 2 жыл бұрын
Great video! Thnk you for making it. Got this error in Colab. ModuleNotFoundError: No module named 'KNN' when running from KNN import KNN
@AssemblyAI
@AssemblyAI 2 жыл бұрын
You're welcome Santiago! You should include the KNN python file we develop in the video in the file system of the collab notebook. That should get rid of the error! :)
@1000marcelo1000
@1000marcelo1000 2 жыл бұрын
Amazing!
@abheermehrotra329
@abheermehrotra329 Жыл бұрын
how to setup my machine with all these libraries ???
@jonforhan9196
@jonforhan9196 Жыл бұрын
pip
@Code_Catalysts
@Code_Catalysts 10 ай бұрын
numpy error in vscode???
@AbdellahEnajari
@AbdellahEnajari 21 күн бұрын
👌👌👍👍👍👍
@tebibusolomon1529
@tebibusolomon1529 3 ай бұрын
i love you
@FearFlicks-ue6ex
@FearFlicks-ue6ex Ай бұрын
There is no teacher on this planet that can explain python, machine learning in a proper sequence and an entertaining way. I don't know what is she doing in this video. Also, she is not explaining whatever she is typing all that Chinese stuff.
@systemforge
@systemforge Жыл бұрын
nice
@sidekick3rida
@sidekick3rida Жыл бұрын
How to implement knn from scratch… import numpy and sklearn ¯\_(ツ)_/¯
@orioncloud4697
@orioncloud4697 2 жыл бұрын
Thx, however, this euclidean distance function needs to be corrected.
@osviiii
@osviiii 2 жыл бұрын
It's actually ok I'd say
@orioncloud4697
@orioncloud4697 2 жыл бұрын
@@osviiii yeap i checked that, i just confused a little
@firstlast-wz9jv
@firstlast-wz9jv Жыл бұрын
thank you for the practice... but it's an exact copy from this one kzbin.info/www/bejne/pJivqotracpkgrc created 4 years ago
@AssemblyAI
@AssemblyAI Жыл бұрын
Yes! Pat works with me too, we decided to do a new run of his videos :)
@lalalalaal7209
@lalalalaal7209 2 жыл бұрын
Are you Turkish
@AssemblyAI
@AssemblyAI 2 жыл бұрын
Yes!
@dostseferoglu6853
@dostseferoglu6853 Жыл бұрын
@@AssemblyAI that "i" in range pronounciation gave it away :D
@KemalDirican-f2o
@KemalDirican-f2o 2 ай бұрын
Lewis Brenda Walker James Jackson Charles
@GeorgeZoto
@GeorgeZoto Жыл бұрын
I like this approach, it is so helpful. Curious how it compares with sklearn's version of sklearn.neighbors.KNeighborsClassifier 😃
@michaelduffy5309
@michaelduffy5309 Жыл бұрын
I went through all of these Assembly AI lessons, making each one work perfectly. Then I redid each one using Scikit Learn classes. In every case, I was able to drop in the sklearn equivalent and get the same or better results. A good entree into Scikit Learn.
How to implement Linear Regression from scratch with Python
17:03
How to Build Your First KNN Python Model in scikit-learn (K Nearest Neighbors)
21:15
Ryan & Matt Data Science
Рет қаралды 3,8 М.
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 93 МЛН
How to implement Decision Trees from scratch with Python
37:24
AssemblyAI
Рет қаралды 70 М.
What is the K-Nearest Neighbor (KNN) Algorithm?
8:01
IBM Technology
Рет қаралды 20 М.
ML Was Hard Until I Learned These 5 Secrets!
13:11
Boris Meinardus
Рет қаралды 340 М.
K-Means Clustering model from Scratch using Python | Step-by-Step Guide
24:26
StatQuest: K-nearest neighbors, Clearly Explained
5:30
StatQuest with Josh Starmer
Рет қаралды 651 М.
How to implement Random Forest from scratch with Python
13:31
AssemblyAI
Рет қаралды 28 М.
K Nearest Neighbour Easily Explained with Implementation
18:02
Krish Naik
Рет қаралды 246 М.
How I would learn Machine Learning (if I could start over)
7:43
AssemblyAI
Рет қаралды 762 М.