K-Nearest Neighbors Algorithm From Scratch In Python

  Рет қаралды 11,139

The Teen Innovator

The Teen Innovator

Күн бұрын

Here is a python implementation of KNN, make sure to leave your questions down below!
CSV File: drive.google.com/file/d/1WKa_...
Try my FAVORITE coding resource:
www.datacamp.com?tap_a=5644-dce66f&tap_s=1065405-0291e3&
Consider...
Subscribing: / @theteeninnovator
i would love to hear any suggestions you have, leave them down in the comments!! (video ideas, editing tips, anything!!)

Пікірлер: 31
@user-ic8oq5dc2c
@user-ic8oq5dc2c 2 жыл бұрын
Such an impressive video! You explained everything so simply and clearly, taking the viewer from the basic concepts in the beginning to the details at the end. This is one of your best. Amazing.
@TheTeenInnovator
@TheTeenInnovator 2 жыл бұрын
Thank you so much Cheni! Always appreciate the support 😎
@user-ic8oq5dc2c
@user-ic8oq5dc2c 2 жыл бұрын
I watched the whole thing! So good!
@amirhrcrash
@amirhrcrash 2 жыл бұрын
Thanks mate, it helped a lot !
@TheTeenInnovator
@TheTeenInnovator 2 жыл бұрын
Of course!
@AHMADKELIX
@AHMADKELIX 2 жыл бұрын
permission to learn sir.thank you
@shivammodi553
@shivammodi553 2 жыл бұрын
At 14:42 I think the name of the function should be Manhatten distance as you had summed the differences and then squared rather than summing up the square of differences.
@NawafRabah
@NawafRabah Жыл бұрын
I'm taking a machine learning course with datacamp and it's stupid because they go over everything like you already know it. I really appreciate what you're doing but can you go into details about the core stuff especially the classifications. y_train, x_train, ...etc are stuff that I can't understand yet. Could you show us why things are the way they are in your code this will help us overcome the barrier of making sense of it all. Thanks.
@deltaeconomics7524
@deltaeconomics7524 Жыл бұрын
Great video, quick question... Let's say if want to predict based on age equals 35, salary equals $80,000 what is function to predict whether or not a paper buys the phone? Thank you
@fr.nijoantony2270
@fr.nijoantony2270 Жыл бұрын
mode(labels).mode[0] showing error
@whimsicalvibes
@whimsicalvibes 2 жыл бұрын
Thanks for the great video. It made me start using Kaggle and more of seaborn. You did not do the Euclidean Distance correctly, due to a missing brackets in step 10. Correct euclidean distance is 5.385
@TheTeenInnovator
@TheTeenInnovator 2 жыл бұрын
I appreciate the comment! I noticed that I made an error in the way I calculated Euclidean distance a while back, just updated the repo!
@dingyomnivore
@dingyomnivore Жыл бұрын
I get error euclidean_distance() missing 1 required positional argument: 'pt2'
@davidzepeda3071
@davidzepeda3071 Жыл бұрын
"name 'train_test_split' is not defined" I seem to get this error when running it. There was nowhere else it was called before.
@MAHESH-ho4xn
@MAHESH-ho4xn 3 ай бұрын
you need to import a package from sklearn
@user-df3zg8ie6f
@user-df3zg8ie6f 2 жыл бұрын
I get an error when i use the accuracy function passing the y_test and y_hat_test arguments "Found input variables with inconsistent numbers of samples" do you know what is the problem? Thanks alot!
@HAsmaa-zg6rt
@HAsmaa-zg6rt 2 жыл бұрын
happened to me too. seams that X and Y should have the same amount, i did X.shape found : 13,1101 Y.shape found : 1101 I still can't solve it.
@vishvpatel3269
@vishvpatel3269 2 жыл бұрын
i have faced this error please help me " euclidean_distance() missing 1 required positional argument: 'pt2' "
@rammiokal
@rammiokal 2 жыл бұрын
i got the same problem lol
@tilakbhattacharya9184
@tilakbhattacharya9184 2 жыл бұрын
same
@ashokjayam3231
@ashokjayam3231 Жыл бұрын
can you explain with using functions please
@TheTeenInnovator
@TheTeenInnovator Жыл бұрын
A function is a way to execute lines of code using a single command without repetitively running the same code over and over, I suggest looking here: www.programiz.com/python-programming/function#:~:text=In%20Python%2C%20a%20function%20is,and%20makes%20the%20code%20reusable.
@CB_2023
@CB_2023 2 жыл бұрын
I keep getting this error: TypeError: KNN() got multiple values for argument 'k_val' Any ideas on how to fix it?
@TheTeenInnovator
@TheTeenInnovator 2 жыл бұрын
If you send me your code I can take a look, you can send it to Yakar.noam56@gmail.com
@CB_2023
@CB_2023 2 жыл бұрын
@@TheTeenInnovator Done! And thanks for the reply. :)
@faracullaazizli8954
@faracullaazizli8954 2 жыл бұрын
Pls tell the reply , how to get rid of this .
@grandhibaladurgasaikrishna7268
@grandhibaladurgasaikrishna7268 2 жыл бұрын
it is better if you have added source code please add it !!
@TheTeenInnovator
@TheTeenInnovator 2 жыл бұрын
It is on my GitHub NoamYakarOfficial!
@helaolange
@helaolange 2 жыл бұрын
What is your GitHub account??
@TheTeenInnovator
@TheTeenInnovator Жыл бұрын
NoamYakarOfficial
@kelixoderamirez
@kelixoderamirez 2 жыл бұрын
permission to learn sir. thank you
Using The KNN Algorithm To Predict IPhone Sales | Scikit Learn in Python
21:59
Linear Regression From Scratch in Python (Mathematical)
24:38
NeuralNine
Рет қаралды 155 М.
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 44 МЛН
Is it Cake or Fake ? 🍰
00:53
A4
Рет қаралды 19 МЛН
Кәріс өшін алды...| Synyptas 3 | 10 серия
24:51
kak budto
Рет қаралды 1,3 МЛН
Python KNN - K Nearest Neighbors | ML Classification
11:45
Oggi AI - Artificial Intelligence Today
Рет қаралды 5 М.
k nearest neighbor in Python
29:10
Nick Stugard
Рет қаралды 1,5 М.
Decision Tree Classification in Python (from scratch!)
17:43
Normalized Nerd
Рет қаралды 179 М.
Is Plotly The Better Matplotlib?
22:58
NeuralNine
Рет қаралды 93 М.