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 where the goal is to predict the class of an instance using its features. The model learns from labeled examples in a training set and then assigns a class to new, unseen data.

Regression predicts a continuous numeric value (e.g., price), which can take many possible values. Classification predicts a categorical value (e.g., type of sweet), choosing one option from a limited set of classes.

There are several types of classification:

  • Binary classification: the target has two possible outcomes (spam/not spam, cookie/not cookie);
  • Multi-class classification: three or more possible categories (spam/important/ad/other; cookie/marshmallow/candy);
  • Multi-label classification: an instance can belong to multiple classes simultaneously (a movie can be action and comedy; an email can be 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 the difference between binary, multi-class, and multi-label classification in more detail?

What are some common use cases for classification and regression?

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

bookWhat is Classification

Swipe to show menu

Classification is a supervised learning task where the goal is to predict the class of an instance using its features. The model learns from labeled examples in a training set and then assigns a class to new, unseen data.

Regression predicts a continuous numeric value (e.g., price), which can take many possible values. Classification predicts a categorical value (e.g., type of sweet), choosing one option from a limited set of classes.

There are several types of classification:

  • Binary classification: the target has two possible outcomes (spam/not spam, cookie/not cookie);
  • Multi-class classification: three or more possible categories (spam/important/ad/other; cookie/marshmallow/candy);
  • Multi-label classification: an instance can belong to multiple classes simultaneously (a movie can be action and comedy; an email can be 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