721
edits
Line 5: | Line 5: | ||
[https://replit.com/@abnutzer/Homework-2-Solution#main.cpp Calculation of the Centroid] | [https://replit.com/@abnutzer/Homework-2-Solution#main.cpp Calculation of the Centroid] | ||
=Description of | =Description of Classifier Code from Session 4= | ||
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. 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 all known classes as shown in the picture below. | |||
[[File:2d_classify.png|800px]] | [[File:2d_classify.png|800px]] |