Classification Clustering Recommender System
Classification Clustering Recommender System
Classification is a task that requires the use of machine learning algorithms that learn
how to assign a class label to examples from the problem domain. An easy to
understand example is classifying emails as “spam” or “not spam.”
There are many different types of classification tasks that you may encounter in machine
learning and specialized approaches to modelling that may be used for each.
Binary Classification
Binary classification refers to those classification tasks that have two class labels.
Examples include:
• Email spam detection (spam or not).
• Churn prediction (churn or not).
• Conversion prediction (buy or not).
Typically, binary classification tasks involve one class that is the normal state and
another class that is the abnormal state.
For example “not spam” is the normal state and “spam” is the abnormal state. Another
example is “cancer not detected” is the normal state of a task that involves a medical
test and “cancer detected” is the abnormal state.
The class for the normal state is assigned the class label 0 and the class with the
abnormal state is assigned the class label 1.
It is common to model a binary classification task with a model that predicts a Bernoulli
probability distribution for each example.
The Bernoulli distribution is a discrete probability distribution that covers a case where
an event will have a binary outcome as either a 0 or 1. For classification, this means that
the model predicts a probability of an example belonging to class 1, or the abnormal
state.
• Logistic Regression
• k-Nearest Neighbors
• Decision Trees
• Support Vector Machine
• Naive Bayes
Multi-Class Classification
Multi-class classification refers to those classification tasks that have more than two
class labels.
Examples include:
• Face classification.
• Plant species classification.
• Optical character recognition.
Unlike binary classification, multi-class classification does not have the notion of normal
and abnormal outcomes. Instead, examples are classified as belonging to one among a
range of known classes.
The number of class labels may be very large on some problems. For example, a model
may predict a photo as belonging to one among thousands or tens of thousands of faces
in a face recognition system.
Problems that involve predicting a sequence of words, such as text translation models,
may also be considered a special type of multi-class classification. Each word in the
sequence of words to be predicted involves a multi-class classification where the size of
the vocabulary defines the number of possible classes that may be predicted and could
be tens or hundreds of thousands of words in size.
• k-Nearest Neighbors.
• Decision Trees.
• Naive Bayes.
• Random Forest.
• Gradient Boosting.
Scatter Plot of Multi-Class Classification Dataset
Multi-Label Classification
Multi-label classification refers to those classification tasks that have two or more class
labels, where one or more class labels may be predicted for each example.
Consider the example of photo classification, where a given photo may have multiple
objects in the scene and a model may predict the presence of multiple known objects in
the photo, such as “bicycle,” “apple,” “person,” etc.
This is unlike binary classification and multi-class classification, where a single class
label is predicted for each example.
It is common to model multi-label classification tasks with a model that predicts multiple
outputs, with each output taking predicted as a Bernoulli probability distribution. This is
essentially a model that makes multiple binary classification predictions for each
example.
Imbalanced Classification
Imbalanced classification refers to classification tasks where the number of examples in
each class is unequally distributed.
Typically, imbalanced classification tasks are binary classification tasks where the
majority of examples in the training dataset belong to the normal class and a minority of
examples belong to the abnormal class.
Examples include:
• Fraud detection.
• Outlier detection.
• Medical diagnostic tests.
These problems are modelled as binary classification tasks, although may require
specialized techniques.
1. Lazy Learners: Lazy Learner firstly stores the training dataset and wait until it
receives the test dataset. In Lazy learner case, classification is done on the basis
of the most related data stored in the training dataset. It takes less time in
training but more time for predictions.
Example: K-NN algorithm, Case-based reasoning
2. Eager Learners:Eager Learners develop a classification model based on a
training dataset before receiving a test dataset. Opposite to Lazy learners, Eager
Learner takes more time in learning, and less time in
prediction. Example: Decision Trees, Naïve Bayes, ANN.
o Linear Models
o Logistic Regression
o Support Vector Machines
o Non-linear Models
o K-Nearest Neighbours
o Kernel SVM
o Naïve Bayes
o Decision Tree Classification
o Random Forest Classification
Clustering
It is basically a type of unsupervised learning method. An unsupervised
learning method is a method in which we draw references from datasets
consisting of input data without labeled responses. Generally, it is used as a
process to find meaningful structure, explanatory underlying processes,
generative features, and groupings inherent in a set of examples.
Clustering is the task of dividing the population or data points into a number
of groups such that data points in the same groups are more similar to other
data points in the same group and dissimilar to the data points in other
groups. It is basically a collection of objects on the basis of similarity and
dissimilarity between them.
For ex– The data points in the graph below clustered together can be
classified into one single group. We can distinguish the clusters, and we can
identify that there are 3 clusters in the below picture.
Example: Let's understand the clustering technique with the real-world example of
Mall: When we visit any shopping mall, we can observe that the things with similar
usage are grouped together. Such as the t-shirts are grouped in one section, and
trousers are at other sections, similarly, at vegetable sections, apples, bananas,
Mangoes, etc., are grouped in separate sections, so that we can easily find out the
things. The clustering technique also works in the same way. Other examples of
clustering are grouping documents according to the topic.
The clustering technique can be widely used in various tasks. Some most common uses
of this technique are:
o Market Segmentation
o Statistical data analysis
o Social network analysis
o Image segmentation
o Anomaly detection, etc.
Apart from these general usages, it is used by the Amazon in its recommendation
system to provide the recommendations as per the past search of
products. Netflix also uses this technique to recommend the movies and web-series
to its users as per the watch history.
The below diagram explains the working of the clustering algorithm. We can see the
different fruits are divided into several groups with similar properties.
1. Partitioning Clustering
2. Density-Based Clustering
3. Distribution Model-Based Clustering
4. Hierarchical Clustering
5. Fuzzy Clustering
Partitioning Clustering
It is a type of clustering that divides the data into non-hierarchical groups. It is also
known as the centroid-based method. The most common example of partitioning
clustering is the K-Means Clustering algorithm.
In this type, the dataset is divided into a set of k groups, where K is used to define the
number of pre-defined groups. The cluster center is created in such a way that the
distance between the data points of one cluster is minimum as compared to another
cluster centroid.
Density-Based Clustering
The density-based clustering method connects the highly-dense areas into clusters,
and the arbitrarily shaped distributions are formed as long as the dense region can
be connected. This algorithm does it by identifying different clusters in the dataset and
connects the areas of high densities into clusters. The dense areas in data space are
divided from each other by sparser areas.
These algorithms can face difficulty in clustering the data points if the dataset has
varying densities and high dimensions.
Clustering Algorithms
The Clustering algorithms can be divided based on their models that are explained
above. There are different types of clustering algorithms published, but only a few are
commonly used. The clustering algorithm is based on the kind of data that we are
using. Such as, some algorithms need to guess the number of clusters in the given
dataset, whereas some are required to find the minimum distance between the
observation of the dataset.
Recommender Systems
Recommender systems are the systems that are designed to recommend things to the user based
on many different factors. These systems predict the most likely product that the users are most
likely to purchase and are of interest to. Companies like Netflix, Amazon, etc. use
recommender systems.
• Personalized content.
2. Collaborative filtering: The disadvantage of the content filtering is that it need the
side information for each item. The collaborative filtering are done based on the user's
behaviour. History of the user plays an important role. It is of two types.
I. User-User collaborative filtering: In this, user vector include all the item purchased
by the user and the rating given for each particular product.
II. Item-Item collaborative filtering: In this, rather than considering similar users,
similar items are considered.