Blog

Categories

Recent Posts: Classification

k-Nearest Neighbors

k-Nearest Neighbors, or k-NN as I am going to call it from now on, is one of the easiest algorithms to solve classification tasks. It can be used for regression problems as well, but I am going to focus on the more common use case of classification in this post. In a nutshell, k-NN will assign a new data point to the class that the majority of its k neighbors in the training set belongs to. Let’s use another coffee-related example to see how that works.

[ > Read more ]

Detect Forged Banknotes with a Logistic Regression

Counterfeit money is a serious problem for both individuals and businesses. Counterfeiters constantly find new ways and techniques to produce fake banknotes, that are essentially indistinguishable from real money. At least for the human eye! Identifying forged banknotes is a typical example of a binary classification task in Machine Learning. If we have enough data of both real and forged banknotes, we can use this data to train a model that can classify new banknotes as either real or fake.

[ > Read more ]

Linear and Logistic Regression

Linear and Logistic regression are among the most elementary algorithms for supervised learning. Supervised Learning describes the situation where we deal with labeled data, which means that we have labeled inputs and a target variable. Despite the fact that both have the word “regression” in their name, only one of them is typically being used for solving regression problems! Let’s see how they work! Linear Regression Linear regression is possibly the easiest, most intuitive way of making a quantitative prediction. The relationship between an independent and a dependent variable is assumed to be linear, meaning that the dependent variable can be predicted using a linear function of the independent variable. For example:

[ > Read more ]