Introduction to Machine Learning

Introduction to Machine Learning:  

Machine learning is a branch of artificial intelligence (AI) and computer science that focuses on using data and algorithms to imitate how humans learn, gradually improving its accuracy.

In traditional programming, a computer engineer writes a series of directions that instruct a computer how to transform input data into a desired output. Instructions are mostly based on an IF-THEN structure: when certain conditions are met, the program executes a specific action

Machine learning, on the other hand, is an automated process that enables machines to solve problems with little or no human input, and take actions based on past observations.


                                            Figure1: Venn Diagram


Machine Learning algorithms are programs that can learn the hidden patterns from the data, predict the output, and improve the performance from experiences on their own. Different algorithms can be used in machine learning for different tasks, such as simple linear regression that can be used for prediction problems like stock market prediction, and the KNN algorithm can be used for classification problems.

Types of Machine Learning Algorithms

Machine Learning Algorithm can be broadly classified into three types:

  1. Supervised Learning Algorithms
  2. Unsupervised Learning Algorithms
  3. Reinforcement Learning algorithm

The below diagram illustrates the different ML algorithms, along with the categories:

                                                    Figure 2: Different ML Algorithms

1) Supervised Learning Algorithm

Supervised learning is a type of Machine learning in which the machine needs external supervision to learn. The supervised learning models are trained using the labeled dataset. Once the training and processing are done, the model is tested by providing sample test data to check whether it predicts the correct output.

The goal of supervised learning is to map input data with the output data. Supervised learning is based on supervision, and it is the same as when a student learns things under the teacher's supervision. An example of supervised learning is spam filtering.

Supervised learning can be divided further into two categories of problems:

  • Classification
  • Regression

Examples of some popular supervised learning algorithms are Simple Linear regression, Decision Tree, Logistic Regression, KNN algorithm, etc. 

2) Unsupervised Learning Algorithm

It is a type of machine learning in which the machine does not need any external supervision to learn from the data, hence called unsupervised learning. The unsupervised models can be trained using the unlabelled dataset that is not classified, nor categorized, and the algorithm needs to act on that data without any supervision. In unsupervised learning, the model doesn't have a predefined output, and it tries to find useful insights from a huge amount of data. These are used to solve the Association and Clustering problems. Hence further, it can be classified into two types:

  • Clustering
  • Association

Examples of some Unsupervised learning algorithms are K-means Clustering, Apriori Algorithm, Eclat, etc. 

3) Reinforcement Learning

In Reinforcement learning, an agent interacts with its environment by producing actions and learns with the help of feedback. The feedback is given to the agent in the form of rewards, such as for each good action, he gets a positive reward, and for each bad action, he gets a negative reward. There is no supervision provided to the agent. Q-Learning algorithm is used in reinforcement learning. 

List of Popular Machine Learning Algorithms

1.     Linear Regression Algorithm

2.     Logistic Regression Algorithm

3.     Decision Tree

4.     SVM

5.     Naïve Bayes

6.     KNN

7.     K-Means Clustering

8.     Random Forest

9.     Apriori

10.  PCA

Difference Between Supervised and Unsupervised Learning Algorithms

Points

SUPERVISED LEARNING

UNSUPERVISED LEARNING

Input Data

Uses Known and Labeled Data as input

Uses Unknown Data as input

Computational Complexity

Less Computational Complexity

More Computational Complex

Real Time

Uses off-line analysis

Uses Real Time Analysis of Data

Number of Classes

The number of Classes is known

The number of Classes is not known

Accuracy of Results

Accurate and Reliable Results

Moderate Accurate and Reliable Results

Output data

Desired output is given.

Desired output is not given.

Model

In supervised learning, it is not possible to learn larger and more complex models than with supervised learning

In unsupervised learning, it is possible to learn larger and more complex models than  with unsupervised learning

Training data

In supervised learning training data is used to infer model

In unsupervised learning training data is not used.

Another name

Supervised learning is also called classification.

Unsupervised learning is also called clustering.

Test of model

We can test our model.

We can not test our model.

Example

Optical Character Recognition

Find a face in an image

Classification Vs. Regression:

Regression and Classification algorithms are Supervised Learning algorithms. Both algorithms are used for prediction in Machine learning and work with the labeled datasets. But the difference between both is how they are used for different machine learning problems.

The main difference between Regression and Classification algorithms is that Regression algorithms are used to predict continuous values such as price, salary, age, etc., and Classification algorithms are used to predict/Classify discrete values such as Male or Female, True or False, Spam or Not Spam, etc.

Consider the below diagram which specifies the difference between the classification and regression

         Classification             Regression

Difference between Regression and Classification

 

Sr.No.

Regression Algorithm

Classification Algorithm

1.    

In Regression, the output variable must be of continuous nature or real value.

In Classification, the output variable must be a discrete value.

2.    

The task of the regression algorithm is to map the input value (x) with the continuous output variable(y).

The task of the classification algorithm is to map the input value(x) with the discrete output variable(y).

3.    

Regression Algorithms are used with continuous data.

Classification Algorithms are used with discrete data.

4.    

In Regression, we try to find the best fit line, which can predict the output more accurately.

In Classification, we try to find the decision boundary, which can divide the dataset into different classes.

5.    

Regression algorithms can be used to solve the regression problems such as Weather Prediction, House price prediction, etc.

Classification Algorithms can be used to solve classification problems such as Identification of spam emails, Speech Recognition, Identification of cancer cells, etc.

6.    

The regression Algorithm can be further divided into Linear and Non-linear Regression.

The Classification algorithms can be divided into Binary Classifiers and Multi-class Classifiers.

7.    

Problems like House Price PredictionRainfall Prediction like problems are solved using regression Algorithms.

Problems like Spam Email ClassificationDisease prediction like problems are solved using Classification Algorithms.

8.    

Evaluation metrics like Mean Squared Error, R2-Score, and  MAPE are used here to evaluate the performance of the regression algorithms

Evaluation metrics like Precision, Recall, and F1-Score are used here to evaluate the performance of the classification algorithms.

 

Comments

Popular posts from this blog

Linear Regression

Logistic Regression

k-Nearest Neighbors Algorithm