Machine Learning Course - Lesson 12: Elongation Feature

Поделиться
HTML-код
  • Опубликовано: 6 авг 2024
  • To improve the accuracy of our machine learning classifier, we'll implement another feature where we measure how elongated a shape is. We do this by first computing the convex hull, then finding which oriented bounding box has the smallest area and finally dividing it's width (the longest side) to the height (the shortest side). Then, we add this feature to create a 3 dimensional feature vector and use the KNN classifier using the Euclidean distance.
    The Course: • Machine Learning Course
    💻 Code
    github.com/gniziemazity/ml-co...
    ✔️ Use P3 to follow along
    ✔️ P4 is the code after this lesson
    💻Ilya's code: gist.github.com/id-ilych/8630...
    Interpolation Video:
    • Linear Interpolation (...
    Euclidean Distance Video:
    • Euclidean Distance: Ma...
    ⭐️TIMESTAMPS⭐️
    00:00 Course Introduction
    02:05 Reviewing Ilya's Code
    04:54 Debugging the Code
    08:25 Elongation Feature
    11:00 Euclidean Distance
    16:08 Analysis and Discussion

Комментарии • 27

  • @pesterenan
    @pesterenan Год назад +3

    My god, I just began to watch and I'm already impressed at that convex hull algorithym!!! How people think of those things?! Hahah great work Ilya!

    • @Radu
      @Radu  Год назад +1

      Many more advanced algorithms are abstract, like that. It becomes easier to come up with abstract things if you are familiar with abstract things to begin with. So, studying and learning different approaches helps.

  • @roomanhaider
    @roomanhaider Год назад +2

    sir you are the best teacher in the world i love you

    • @Radu
      @Radu  Год назад +1

      I'm glad you like the content!

  • @thefuntech2810
    @thefuntech2810 Год назад +2

    He is a Genius

    • @Radu
      @Radu  Год назад

      Not really, just a lot of practice :-)

  • @yassinabdelmahdi2008
    @yassinabdelmahdi2008 Год назад +2

    we are waiting for the next video

    • @Radu
      @Radu  Год назад +1

      Cool! Coming out next Monday.

  • @javifontalva7752
    @javifontalva7752 Год назад +1

    I am speechless. 😮

    • @Radu
      @Radu  Год назад

      How so? :-)

  • @rudro314
    @rudro314 Год назад +1

    Always eager to know more about ML from you❤

    • @Radu
      @Radu  Год назад +1

      More to come!

  • @yassinabdelmahdi2008
    @yassinabdelmahdi2008 Год назад +2

    Thank you for this great content

    • @Radu
      @Radu  Год назад +1

      Glad you enjoy it!

  • @yassinabdelmahdi2008
    @yassinabdelmahdi2008 Год назад +1

    Roundness will help to increase the accuracy?

    • @Radu
      @Radu  Год назад +1

      It will. But it's important to understand why it works, what we accomplish by using it. And what other features could be used as well.

  • @AZHARakaGoat
    @AZHARakaGoat Год назад +2

    Can u explain the coincident box and minboxbounding functions I don't understand these

    • @Radu
      @Radu  Год назад +1

      The idea is that the minimum bounding box (sallest area) must contain one of the edges of the convex hull, so the minimumBoundingBox tries all possible edges one by one and keeps the one with the minimum area (tightest fit). To do that, it uses the coincidentBox function which does basic vector operations (they are defined at the top: diff, dot, len, etc... they are the same as in my video on Vectors). It then rotates each point of the convex hull along the segment of interest (i, j) and outputs the oriented bounding box. Hope this helps :-)

    • @AZHARakaGoat
      @AZHARakaGoat Год назад +2

      @Radu
      Doest it rotate each point of hull to same as angle of interest iand j,
      but I don't understood what baseX baseY n and v variables are what's it's main purposes are how and why is it calculated and why r we multiplying the baseX to left and adds it to origin
      Now I understand the minimum bounding box function but coincident function except last lines look scary 😨

    • @Radu
      @Radu  Год назад +1

      @@AZHARakaGoat baseX is the direction I color in red when I give examples of the oriented bounding boxes in the beginning animation. baseY is perpendicular to that. Imagine an XY cartesian space where X is along baseX and Y is just at 90 degrees. n is as the difference vector relative to the origin and v is the position in the new XY space constructed with respect to baseX and baseY. It's just linear algebra, maybe you should study it more :-) look for the linear algebra course from 3blue1brown. I remember it's pretty good!

    • @AZHARakaGoat
      @AZHARakaGoat Год назад +2

      @@Radu I will learn it is this the course
      ruclips.net/p/PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab

    • @Radu
      @Radu  Год назад

      yes

  • @rodrigueban9562
    @rodrigueban9562 Год назад +1

    hey Radu do you have a course where you teach novice like me???

    • @Radu
      @Radu  Год назад

      I think the most beginner-friendly content I have is the html canvas course and the math and code fundamentals playlist.

  • @AZHARakaGoat
    @AZHARakaGoat Год назад +2

    WoW 👌 Good video
    But iam confused did we used 3rd dim in confusion matrix 🤔
    Also I didn't understood the graham algo
    Can u explain how did we calculated orientation and angle
    And is it the correct implemented. Lowest point func
    function lowest(p){
    const r = p.reduce((a,c) => (c[1] > a[1] || (c[1] == a[1] && c[0] < a[1])) ? c : a,[0,0])
    log(r)
    }

    • @Radu
      @Radu  Год назад +2

      We did use the 3rd dimension. The confusion matrix at 13:00 uses 2 dimensions. The one 4 seconds later uses 3.
      I don't think I can do a good job explaining new things (orientation and angle) in the comments. But I'm sure you can find resources on those online. (btw, my two videos on vectors and trigonometry teach some things about angles, but not about the orientation, if I remember right... or maybe I do mention the dot product... sorry, can't remember right now :-))
      About your code, I think it's OK. It also keeps the left-most element in case several points have the same [1] value.

    • @AZHARakaGoat
      @AZHARakaGoat Год назад +2

      @@Radu OK 👍