# Month: March 2019

## Logistic Regression in One Line Python

Logistic regression is a popular algorithm for classification problems (despite its name indicating that it is a “regression” algorithm). It belongs to one of the most important algorithms in the machine learning space. The Basics Let’s review linear regression. Given the training data, we compute a line that fits this training data so that the …

## Random Forest Classifier Made Simple

This tutorial introduces you into an exciting machine learning technique: ensemble learning. Here’s my quick and dirty tip if your prediction accuracy sucks but you need to meet the deadline at all costs: try this “meta-learning” approach that combines the predictions (or classifications) of multiple machine learning algorithms. In many cases, it will give you …

## [One-Liner Tutorial] Support Vector Machines Made Simple

Support Vector Machines (SVM) have gained huge popularity in recent years. The reason is their robust classification performance – even in high-dimensional spaces: Surprisingly, SVMs even work if there are more dimensions (features) than data items. This is unusual for classification algorithms because of the curse of dimensionality – with increasing dimensionality, the data becomes …

## A Simple Tip to Boost Your Coding Productivity

Although the old Greeks didn’t practice writing computer code, they have already discovered a basic truth about your productivity as a coder. If you fundamentally understand this truth, you’ll go farther and you’ll be more successful than you’ve ever imagined. If you disobey it, your life will be lonely and full of struggle. The thing …

## Decision Tree Learning in One Line Python

Decision Trees are powerful and intuitive tools in your machine learning toolbelt. A big advantage of decision trees is that they are human-readable – in contrast to most other machine learning techniques. You can easily train a decision tree and show it to your supervisors who do not need to know anything about machine learning …

## [Tutorial] Neural Networks Made Easy — A Python One-Liner

Neural Networks have gained massive popularity in the last years. This is not only a result of the improved algorithms and learning techniques in the field but also of the accelerated hardware performance and the rise of General Processing GPU (GPGPU) technology. In this article, you’ll learn about the Multi-Layer Perceptron (MLP) which is one …

## [Tutorial] How to Get the Row with Minimal Variance in One Line of Python Code

You may have read about the ‘V’s in Big Data: Volume, Velocity, Variety, Veracity, Value, Volatility. Variance is yet another important ‘V’ (it measures Volatility of a data set). In practice, variance is an important measure with important application domains in financial services, weather forecasting, and image processing. Variance measures how much the data spreads …

## K-Nearest Neighbors as a Python One-Liner

The popular K-Nearest Neighbors Algorithm is used for regression and classification in many applications such as recommender systems, image classification, and financial data forecasting. It is the basis of many advanced machine learning techniques (e.g. in information retrieval). There is no doubt that understanding KNN is an important building block of your proficient computer science …

## [Tutorial] How to Run K-Means Clustering in 1 Line of Python?

If there is one clustering algorithm you need to know – whether you are a computer scientist, data scientist, or machine learning expert – it’s the k-Means algorithm. In this section, you’ll learn the general idea and when and how to use it in a single line of Python code. You may know about supervised …

## [NumPy] How to Calculate Basic Statistics Along an Axis? (avg, var, std)

This article explains how to calculate basic statistics (average, standard deviation, and variance) along an axis. We use the NumPy library for linear algebra computations. These three ways are very similar — if you understand one of them, you’ll understand all of them. Graphical Explanation Here’s what you want to achieve: Extracting basic statistics from …

## Python String Count [A Short Tutorial]

Want to count how often a substring occurs in a string? Or how many lines a mult-line string has? Use the count method on any string object! You can use a single argument (the substring to be counted), and two optional arguments start and end to indicate the first or the last index of the …