This is all from my own “beginners perspective”. I am NOT claiming to be an expert and welcome any constructive criticism and corrections to anything I may have said that might not be completely accurate 🙂 There are no perfect models. The key is to find the best algorithm for the specific job/problem that needs to be solved”
Algorithm Type: Classification but can sometimes be used for regression.
The idea: store previous output and create “K” imaginary clusters/points where K tends to be “in the center of each cluster as much as possible”. As new predictions come in, measure the distance (usually Euclidean but can be Hamming, Minkowski) between your new point.
The trick is to “choose the number of K’s” (there a few ways to do this)
Source: this is from the recommended Udemy course in Machine Learning that I took

Above, we chose K=5 initially.
Based on the new data point, calculate the distance of the data point from the closest K points (ex: Using euclidean distance). The most K points in a certain category becomes the “class” of your new dependent variable.
Python/R and Javascript have libraries that implement this algorithm and make it relatively easy.



