Sign in

If you are not giving it your 100%, then, you are always stealing from somebody… | https://www.linkedin.com/in/bextuychiev/

To be bookmarked for LIFE: all the multiclass classification metrics you need neatly explained

Photo by Deon Black on Pexels

Introduction

I have recently published my most challenging article, which was on the topic of multiclass classification (MC). The difficulties I have faced along the way were largely due to the excessive number of classification metrics that I had to learn and explain. By the time I finished, I had realized that these metrics deserved an article of their own.

So, this post will be about the 7 most commonly used MC metrics: precision, recall, F1 score, ROC AUC score, Cohen Kappa score, Matthew’s correlation coefficient, and log loss. …


Model selection, developing a strategy, and choosing an evaluation metric

Learn how to tackle any multiclass classification problem with Sklearn. The tutorial covers how to choose a model selection strategy, several multiclass evaluation metrics and how to use them finishing off with hyperparameter tuning to optimize for user-defined metrics.

Photo by Sergiu Iacob on Pexels

Introduction

Even though multi-class classification is not as common, it certainly poses a much bigger challenge than binary classification problems. You can literally take my word for it because this article has been the most challenging post I have ever written (have written close to 70).

I found that the topic of multiclass classification is deep and full of nuances. I have…


Imposing restrictions to protect your code

It is important to protect the internal logic of classes in your packages or programs. By customizing the access and validation of each attribute and method in your class, you ensure the core logic does not get accidentally changed. In this tutorial, you will learn how to implement it using Python properties and properly managing attributes.

Photo by Pixabay on Pexels

In our open-source Python community, all OOP class data is technically public. If you want, you can change much of the internal logic by tapping into the source code and ruin everything for yourself. If your programming background is from another language such as…


Hands-on Tutorials

Learn to control model output based on what’s important to the problem using a confusion matrix

Master the fundamentals of the confusion matrix using Sklearn and build a practical intuition for 3 of the most common metrics used in binary classification: precision, recall, and F1 score.

Photo by Thomas Skirde on Pixabay

Introduction

Classification is a huge part of machine learning. Its benefits and applications are endless — ranging from detecting new asteroids and planets to identifying cancerous cells are all done using classification algorithms.

The type of problems classification solves is divided into two: unsupervised and supervised. Unsupervised models are called neural networks, and they can be trained on unstructured data such as video, audio, and images. In contrast, supervised models work…


Getting Started

Learn to leverage powerful model-based imputation methods

Photo by Alexander Lam on Unsplash

Introduction

Despite the massive number of MOOCs and other online resources, there are still skill gaps in dealing with certain data problems. One example is properly dealing with missing data in real-world datasets. Beginner learners might take this problem lightly, and they are not to blame. Even though it is such a pressing issue, the complexity of data missingness problems has been greatly underestimated because of the availability of small, easy-to-work-with toy datasets.

As a result, many beginner data scientists don’t go beyond simple mean, median, or mode imputation. …


Get practical knowledge in feature engineering numeric variables

Learn the underlying difference between Standardization (Scaling), Normalization, and the Log transforms. Develop strong knowledge in when to apply each of them and choose one method over the other.

Photo by George Becker on Pexels

What does it mean to conform to statistical approaches?

You have probably come across this in courses or articles:

The features in the dataset should conform to the statistical assumptions of the models.

What does it mean to conform to statistical assumptions? Many models implemented in Sklearn might perform poorly if the numeric features do not more or less follow a standard Gaussian (normal) distribution. …


Integrate your classes seamlessly into Standard Python

You can change the functionality of an operator to suit your custom class’s needs. In this tutorial, you will learn about this powerful technique of Object-oriented programming: Operator Overloading in Python.

Photo by kiquebg on Pixabay

Introduction

There are close to 40 operators in Python. Each has a unique function and works with the built-ins of native Python. However, you might have noticed that there are more flexible ones such as ‘+’ (plus), ‘*’ (asterisk), or ‘[]’ (brackets) operators. Depending on what type of data structure you use them on, they behave differently:

These are examples with built-in types. But there are also custom packages…


Develop a robust Feature Selection workflow for any supervised problem

Learn how to face one of the biggest challenges of machine learning with the best of Sklearn feature selectors.

Introduction

Today, it is common for datasets to have hundreds if not thousands of features. On the surface, this might seem like a good thing — more features give more information about each sample. But more often than not, these additional features don’t provide much value and introduce complexity.

The biggest challenge of Machine Learning is to create models that have robust predictive power by using as few features as possible. …


You don’t have to write all the code yourself

Photo by Arek Socha on Pixabay

Whatever you are coding, chances are someone already did something similar. Instead of reinventing the wheel, you can customize someone else’s code to suit your needs. After all, that’s the whole point of the open-source community. This vast pool of code written by millions of people is available at your fingertips if you know just one programming concept — inheritance.

Inheritance is a must for any object-oriented programming language, and Python is no exception. Inheritance allows you to reuse the code others had written and tweak it to your needs. …


Your favorite models choosing features themselves

Photo by Andrea Piacquadio on Pexels

Introduction

There are many feature selection methods in Machine Learning. Each one may give different results depending on how you use them, so it is hard to trust a single method entirely. Wouldn’t it be cool to have multiple methods cast their own vote on whether we should keep a feature or not? It would be just like the Random Forests algorithm, where it combines the predictions of multiple weak learners to form a strong one. It turns out, Sklearn has already given us the tools to make such a feature selector on our own.

Together, using those tools, we will…

Bex T.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store