IFD:EAI SoS21/course material/Session 4: Programming the Classifier Part1: Difference between revisions

From Medien Wiki
Line 9: Line 9:
Until now, we have been looking at points on a 2D plane. We know how to calculate the distance between them and how to find the centroid of a point cloud. Let's call these point clouds classes from now on. With this tool set at hand, we can already code a simple classifier. We could e.g. detect whether any given point (P_new) is closer to the point cloud which we call class_0 or class_1. We can find out, by calculating the distances of P_new to the centroids of the classes c_0 abd c_1 as shown in the picture below.
Until now, we have been looking at points on a 2D plane. We know how to calculate the distance between them and how to find the centroid of a point cloud. Let's call these point clouds classes from now on. With this tool set at hand, we can already code a simple classifier. We could e.g. detect whether any given point (P_new) is closer to the point cloud which we call class_0 or class_1. We can find out, by calculating the distances of P_new to the centroids of the classes c_0 abd c_1 as shown in the picture below.
[[File:2d_classify.png|800px]]
[[File:2d_classify.png|800px]]
In this case the distance d1 is smaller than d0. That would mean our point belongs to class 1 of course.


Why would we want to do that?
===Why care about points on an X-Y plane?!===


Imagine the points are not just drawings on a piece of paper, but actual measurements of real world objects. So instead of  giving the axes in the figure arbitrary names like 'X' and 'Y', we can give them meaningful measures of a short sound recording: 'bass' and 'treble'.
Imagine the points are not just drawings on a piece of paper, but actual measurements of real world objects. So instead of  giving the axes in the figure arbitrary names like 'X' and 'Y', we can give them meaningful measures of a short sound recording: 'bass' and 'treble'.