Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn What is Classification | k-NN Classifier
Classification with Python

bookWhat is Classification

Classification is a supervised learning task. Its goal is to predict the class to which the instance belongs based on a set of parameters (features). You need to give many labeled examples of data (called training set) for the computer to learn before it can predict the class of a new instance.

The difference between classification and regression is that regression predicts a continuous numerical value, for example, a price. It can be any real (only positive for a price) number.

In contrast, classification predicts a categorical value, for example, the type of a sweet. There is a finite set of values, and the model tries to classify each instance into one of these categories.

Based on the formulation of a problem, there are several types of classification:

  • Binary classification: in binary classification, a target is one of two possible outcomes. For example, email: spam/not spam, sweet: cookie/not cookie;

  • Multi-class classification: in multi-class classification, there are three or more possible outcomes for a target. For example, email: spam/important/ad/other, sweet: cookie/marshmallow/candy;

  • Multi-label classification: in multi-label classification, each instance can belong to multiple classes at the same time. For example, a movie can be classified as both action and comedy, or an email can be marked as both important and work-related.

For most ML models, you need to encode the target to a number. For binary classification, outcomes are usually encoded as 0/1 (e.g., 1 - cookie, 0 - not a cookie). For a multi-class classification, outcomes are usually encoded as 0, 1, 2, ... (e.g., 0 - candy, 1 - cookie, 2 - marshmallow).

Many different models can perform classification. Some examples include:

  • k-Nearest Neighbors;
  • Logistic Regression;
  • Decision Tree;
  • Random Forest.

Luckily, they are all implemented in the scikit-learn library and are easy to use.

Note
Note

No machine learning model is superior to any other. Which model will perform best depends on the specific task.

question mark

What is the main goal of classification in machine learning?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain more about the difference between classification and regression?

What are some real-world examples of multi-label classification?

How do I choose which classification model to use for my data?

Awesome!

Completion rate improved to 4.17

bookWhat is Classification

Swipe to show menu

Classification is a supervised learning task. Its goal is to predict the class to which the instance belongs based on a set of parameters (features). You need to give many labeled examples of data (called training set) for the computer to learn before it can predict the class of a new instance.

The difference between classification and regression is that regression predicts a continuous numerical value, for example, a price. It can be any real (only positive for a price) number.

In contrast, classification predicts a categorical value, for example, the type of a sweet. There is a finite set of values, and the model tries to classify each instance into one of these categories.

Based on the formulation of a problem, there are several types of classification:

  • Binary classification: in binary classification, a target is one of two possible outcomes. For example, email: spam/not spam, sweet: cookie/not cookie;

  • Multi-class classification: in multi-class classification, there are three or more possible outcomes for a target. For example, email: spam/important/ad/other, sweet: cookie/marshmallow/candy;

  • Multi-label classification: in multi-label classification, each instance can belong to multiple classes at the same time. For example, a movie can be classified as both action and comedy, or an email can be marked as both important and work-related.

For most ML models, you need to encode the target to a number. For binary classification, outcomes are usually encoded as 0/1 (e.g., 1 - cookie, 0 - not a cookie). For a multi-class classification, outcomes are usually encoded as 0, 1, 2, ... (e.g., 0 - candy, 1 - cookie, 2 - marshmallow).

Many different models can perform classification. Some examples include:

  • k-Nearest Neighbors;
  • Logistic Regression;
  • Decision Tree;
  • Random Forest.

Luckily, they are all implemented in the scikit-learn library and are easy to use.

Note
Note

No machine learning model is superior to any other. Which model will perform best depends on the specific task.

question mark

What is the main goal of classification in machine learning?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 1
some-alt