Handwritten Digits Classification: Logistic Regression from Scratch in Python

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

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

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

    thank you so much for your explanation. could you tell me, why do you divide the input data by 16?

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

      Hi Mohamad, thank you for your question.
      The Digits Dataset I am using from Sklearn is has pixel integer values of 0-16, I am dividing by 16 to normalize the data and make the numbers more manageable numerically,

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

      @@EndlessEngineering Thank you so much for your help and attention

  • @sam_oyeleye
    @sam_oyeleye 3 ปีที่แล้ว +1

    where do we find your previous video that explained the concept....you should place it in the link for those interested in learning more

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

      Hi Samuel,
      Thanks for watching the video. The link for logistic regression and gradient descent concepts videos are provided in the "Suggested Video" section, that is the letter "i" at the top right of the video. There is also a link to the video for logistic regression in the jupyter notebook that I haves linked in the description.

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

      @@EndlessEngineering thank you

  • @Марсель-и9с
    @Марсель-и9с 4 ปีที่แล้ว +1

    when use the split and training sets, you do a comand like =/
    what does =/ mean ? cause i only know /=
    Someone help me, i do have tested many other exemples and cant get a answer..

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

      Hi Anonimo, thanks for you question.
      The syntax I am using when splitting the data is "=\" and not "=/". The "\" can be used in python to split a line into two, in this case I am splitting the line after the assignment operator. It is just to make all the code fit on screen, but if I don't use the "\" syntax python would throw an error.

    • @Марсель-и9с
      @Марсель-и9с 4 ปีที่แล้ว +1

      @@EndlessEngineering Wow, thanks for the answer in such short time. This was really my first time seeing this application.
      cheers

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

    can you please explain more in detail the section where you were training the zero digit? ...I don't fully understand it, and I keep getting errors about my dimensions not fully aligned

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

    Also...what does the forward slash sign you used "\" mean in your code...I get syntax error when I tried to use it on mine, following your example.

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

      The "\" is used to indicate line continuation to the python interpreter. Basically if you each a long line and you want to break it up you can use "\" to do so

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

    Why haven't you written np.dot(params.T, x_bar) instead of np.dot(params, x_bar), don't we need to transpose the weight vector?

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

      Hi Karine, thanks for your question.
      Mathematically you are correct we would need to transpose the params vector to get the dot product. However, the np.dot() functionality allows for doing it without the transpose, as in the documentation it shows that if you have 1-D arrays (vectors) the result is always the inner (dot) product.
      See np.dot documentation here: numpy.org/doc/stable/reference/generated/numpy.dot.html

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

    Hy ... I have some problems and issues ...... When i assign alpha=le-2 so rhe jupyter throughs an error

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

      Sir can u plz tell me as soon as possible

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

      @@kainnatbatool7021 Hi Kainnat, can you please share what error you are getting? Are you using the jupyter notebook here:github.com/endlesseng/ml-vid-code/blob/master/notebooks/logistic_regression_digits_dataset.ipynb

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

    Is this similar to a primitive neural network?

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

      You could think about it like that, although mathematically it is not the similar to a neural network exactly since there is no network with inner connections here. If you were to make a network of logits (on of the models I train in this video) then you can get something similar to a neural network.

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

    How many parameters are there?

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

      Each classifier has as many params as there are pixels in each image.