K-Nearest Neighbors Algorithm From Scratch In Python

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 31

  • @shivammodi553
    @shivammodi553 Před 2 lety +3

    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.

  • @user-ic8oq5dc2c
    @user-ic8oq5dc2c Před 3 lety +4

    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.

  • @fr.nijoantony2270
    @fr.nijoantony2270 Před rokem +3

    mode(labels).mode[0] showing error

  • @davidzepeda3071
    @davidzepeda3071 Před rokem +2

    "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 Před 6 měsíci

      you need to import a package from sklearn

  • @user-xn1ko1fo1j
    @user-xn1ko1fo1j Před dnem

    Did someone get this error ?
    mode(labels).mode[0]
    IndexError: invalid index to scalar variable.

  • @vishvpatel3269
    @vishvpatel3269 Před 2 lety +3

    i have faced this error please help me " euclidean_distance() missing 1 required positional argument: 'pt2' "

  • @deltaeconomics7524
    @deltaeconomics7524 Před 2 lety +1

    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

  • @amirhrcrash
    @amirhrcrash Před 2 lety +2

    Thanks mate, it helped a lot !

  • @AHMADKELIX
    @AHMADKELIX Před 2 lety +1

    permission to learn sir.thank you

  • @NawafRabah
    @NawafRabah Před rokem

    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.

  • @ashokjayam3231
    @ashokjayam3231 Před 2 lety +1

    can you explain with using functions please

    • @TheTeenInnovator
      @TheTeenInnovator  Před 2 lety

      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 Před 2 lety +1

    I keep getting this error: TypeError: KNN() got multiple values for argument 'k_val'
    Any ideas on how to fix it?

    • @TheTeenInnovator
      @TheTeenInnovator  Před 2 lety

      If you send me your code I can take a look, you can send it to Yakar.noam56@gmail.com

    • @CB_2023
      @CB_2023 Před 2 lety

      @@TheTeenInnovator Done! And thanks for the reply. :)

    • @faracullaazizli8954
      @faracullaazizli8954 Před 2 lety

      Pls tell the reply , how to get rid of this .

  • @dingyomnivore
    @dingyomnivore Před rokem

    I get error euclidean_distance() missing 1 required positional argument: 'pt2'

    • @user-xn1ko1fo1j
      @user-xn1ko1fo1j Před dnem

      try this : distances.append(euclidean_distance(np.array(X_train.iloc[i]), test_pt))

  • @user-df3zg8ie6f
    @user-df3zg8ie6f Před 2 lety

    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 Před 2 lety

      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.

  • @grandhibaladurgasaikrishna7268

    it is better if you have added source code please add it !!

  • @helaolange
    @helaolange Před 2 lety +1

    What is your GitHub account??

  • @kelixoderamirez
    @kelixoderamirez Před 2 lety +1

    permission to learn sir. thank you