K-Nearest Neighbor from scratch - Machine Learning Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 14

  • @sohanaryal
    @sohanaryal 4 ปีที่แล้ว +2

    Just found your channel, this playlist along with others is amazing, thanks man

    • @alexchristian220
      @alexchristian220 3 ปีที่แล้ว

      hey bro I want scratch code of KNNimputer is this helpful or not!!!

  • @teetanrobotics5363
    @teetanrobotics5363 4 ปีที่แล้ว

    please order the ML playlistchronologically. Amazing Channel. Please dont stop

  • @ItsNotAllRainbows_and_Unicorns
    @ItsNotAllRainbows_and_Unicorns 4 ปีที่แล้ว +3

    Quite an extensive implementation. Thx. I wonder how it can be implemented with MNIST. I have seen other vids where kNN is usd with MNIST. I wonder what parts of the program would have to be changed.

    • @AladdinPersson
      @AladdinPersson  4 ปีที่แล้ว

      I don't think you have to change anything to run it on mnist. Which part do you think would be problematic?

    • @ItsNotAllRainbows_and_Unicorns
      @ItsNotAllRainbows_and_Unicorns 4 ปีที่แล้ว

      @@AladdinPersson Okay, I looked at the data again. I see how you have two files, data and targets. You're right there should be not much of a problem.

  • @ocamposfaria5106
    @ocamposfaria5106 4 ปีที่แล้ว +1

    thank you for the great tutorial! :)

  • @cyngtr
    @cyngtr 2 ปีที่แล้ว

    Hey aladdin, im currently getting this issue and im unsure as to what is wrong. i assume my data but it doesnt make sense as to why it is wrong?
    File "program.py", line 149, in predict_labels
    k_closest_classes = self.y_train[y_indices[: self.k]].astype(int)
    TypeError: only integer scalar arrays can be converted to a scalar index

  • @CasualGamer669
    @CasualGamer669 3 ปีที่แล้ว

    Can you help me to implement cosine similarity to knn ??

  • @darsh8695
    @darsh8695 4 ปีที่แล้ว +1

    If I am trying to run it with MNIST how do I read in the data?

    • @AladdinPersson
      @AladdinPersson  4 ปีที่แล้ว

      I guess perhaps the easiest is loading it with PyTorch torchvision or something like that. Actually not sure, haven't tried loading mnist outside of pytorch/tensorflow frameworks

    • @AmitDube15
      @AmitDube15 3 ปีที่แล้ว

      you can load data from sklearn
      *from sklearn.datasets import load_digits*
      *mnist = load_digits()*
      *X = **mnist.data*
      *y = **mnist.target*

  • @raphaelprinz304
    @raphaelprinz304 3 ปีที่แล้ว

    i can't import numpy. what should i do?

    • @idiomprog
      @idiomprog 3 ปีที่แล้ว

      You could check if you have numpy installed... pip install numpy