You are on page 1of 17

Types Of ML

Linear Regression

Data Visualization

Activation Function

Gradient Descent

Backpropogation

Cnn and its Layer

Loss and Dense layer

1 Shot Learning

Lstm

MDP

Q-Learning

SARSA

SVM

Bayesian Learning

Natural Language Processing

Machine learning is a subfield of artificial intelligence that gives computers the ability to learn without
explicitly being programmed. It involves feeding data to machines and training them using various
algorithms to identify patterns and make decisions with minimal human intervention ⁸.

- **Linear Regression**: A type of supervised learning algorithm used to predict a continuous outcome
variable based on one or more predictor variables.

- **Data Visualization**: The graphical representation of data and information to help users understand
and analyze it.

- **Activation Function**: A mathematical function applied to the output of a neural network layer,
which introduces non-linearity into the model.

- **Gradient Descent**: An optimization algorithm used to minimize the cost function in machine
learning models by iteratively adjusting the model's parameters.

- **Backpropagation**: An algorithm used to train neural networks by calculating the gradient of the
loss function with respect to the weights and updating them accordingly.
- **CNN (Convolutional Neural Network)**: A type of neural network commonly used in image
recognition and processing tasks.

- **Loss and Dense layer**: A loss function measures how well a machine learning model is performing,
while a dense layer is a type of layer in a neural network where each neuron is connected to every
neuron in the previous layer.

- **One Shot Learning**: A type of machine learning where the model can recognize new classes based
on just one or very few examples.

- **LSTM (Long Short-Term Memory)**: A type of recurrent neural network designed to remember
long-term dependencies in sequential data.

- **MDP (Markov Decision Process)**: A mathematical framework used to model decision-making in


situations where outcomes are partly random and partly under the control of a decision-maker.

- **Q-Learning**: A reinforcement learning algorithm that learns an optimal action-selection policy by


estimating the expected value of taking an action in a given state.

- **SARSA (State-Action-Reward-State-Action)**: Another reinforcement learning algorithm that learns


an action-value function by updating its Q-values based on the current state, action, reward, next state,
and next action.

- **SVM (Support Vector Machine)**: A type of supervised learning algorithm used for classification and
regression analysis.

- **Bayesian Learning**: A statistical approach to machine learning that involves updating probabilities
based on new data using Bayes' theorem.

- **Natural Language Processing**: A field of machine learning that focuses on enabling machines to
understand, interpret, and generate human language.

Machine learning is a subfield of artificial intelligence that gives computers the ability to learn without
explicitly being programmed. It involves feeding data to machines and training them using various
algorithms to identify patterns and make decisions with minimal human intervention.

There are several types of machine learning, including:

- **Supervised Learning**: The machine is trained on a labeled dataset, where the desired output is
already known. The algorithm learns to map input data to the correct output. This type of learning is
used for classification and regression tasks.
- **Unsupervised Learning**: The machine is trained on an unlabeled dataset, where the desired output
is unknown. The algorithm learns to identify patterns and relationships in the data without any prior
knowledge. This type of learning is used for clustering and dimensionality reduction tasks.

- **Semi-Supervised Learning**: A combination of supervised and unsupervised learning, where the


machine is trained on a partially labeled dataset. The algorithm learns to map input data to the correct
output using both labeled and unlabeled data.

- **Reinforcement Learning**: The machine learns by interacting with its environment and receiving
feedback in the form of rewards or punishments. The algorithm learns to make decisions that maximize
the cumulative reward over time.

Linear regression

Linear regression is a type of supervised learning algorithm used to predict a continuous outcome
variable (also called the dependent variable) based on one or more predictor variables (also called
independent variables or features). The goal of linear regression is to find the best linear relationship
(i.e., a straight line) between the outcome variable and the predictor variables.

In simple linear regression, where there is only one predictor variable, the line can be represented by
the equation `y = b0 + b1*x`, where `y` is the outcome variable, `x` is the predictor variable, `b0` is the y-
intercept, and `b1` is the slope of the line. The slope `b1` represents the average change in the outcome
variable for a one-unit change in the predictor variable. The y-intercept `b0` represents the value of the
outcome variable when the predictor variable is equal to zero.

In multiple linear regression, where there are two or more predictor variables, the line can be
represented by the equation `y = b0 + b1*x1 + b2*x2 + ... + bn*xn`, where `x1`, `x2`, ..., `xn` are the
predictor variables and `b1`, `b2`, ..., `bn` are their respective slopes.

The goal of linear regression is to find the values of `b0`, `b1`, ..., `bn` that minimize the sum of squared
errors (SSE) between the predicted values of the outcome variable and the actual values. This is done
using a method called least squares.

Linear regression makes several assumptions about the data, including that the relationship between
the predictor variables and the outcome variable is linear, that there is no multicollinearity (i.e., high
correlation) among the predictor variables, and that the errors are normally distributed with constant
variance.
Data visualization

Data visualization is a crucial aspect of machine learning that enables analysts to understand and make
sense of data patterns, relationships, and trends. Through data visualization, insights and patterns in
data can be easily interpreted and communicated to a wider audience, making it a critical component of
machine learning¹.

activation function

An activation function is a function used in artificial neural networks which outputs a small value for
small inputs, and a larger value if its inputs exceed a threshold. If the inputs are large enough, the
activation function "fires", otherwise it does nothing. In other words, an activation function is like a gate
that checks that an incoming value is greater than a critical number².

Activation functions are useful because they add non-linearities into neural networks, allowing the
neural networks to learn powerful operations. If the activation functions were to be removed from a
feedforward neural network, the entire network could be re-factored to a simple linear operation or
matrix transformation on its input, and it would no longer be capable of performing complex tasks such
as image recognition².

Well-known activation functions used in data science include the rectified linear unit (ReLU) function,
and the family of sigmoid functions such as the logistic sigmoid function, the hyperbolic tangent, and the
arctangent function².

Gradient Descent

Gradient Descent is an optimization algorithm used to find the values of parameters (coefficients) of a
function (f) that minimizes a cost function (cost). It is best used when the parameters cannot be
calculated analytically (e.g. using linear algebra) and must be searched for by an optimization algorithm¹.

The procedure starts off with initial values for the coefficient or coefficients for the function. These could
be 0.0 or a small random value. The cost of the coefficients is evaluated by plugging them into the
function and calculating the cost. The derivative of the cost is calculated. The derivative is a concept
from calculus and refers to the slope of the function at a given point. We need to know the slope so that
we know the direction (sign) to move the coefficient values in order to get a lower cost on the next
iteration¹.

Backpropagation

Backpropagation is a widely used algorithm for training feedforward artificial neural networks or other
parameterized networks with differentiable nodes¹. It is used to train the neural network of the chain
rule method. In simple terms, after each feed-forward passes through a network, this algorithm does
the backward pass to adjust the model’s parameters based on weights and biases⁵.

A Convolutional Neural Network (CNN

A Convolutional Neural Network (CNN) is a type of deep learning algorithm that is particularly well-
suited for image recognition and processing tasks. It is made up of multiple layers, including
convolutional layers, pooling layers, and fully connected layers³.

The basic architecture of a CNN consists of two main parts: a convolution tool that separates and
identifies the various features of the image for analysis in a process called as Feature Extraction, and a
fully connected layer that utilizes the output from the convolution process and predicts the class of the
image based on the features extracted in previous stages¹.

• A Convolutional Neural Network, or CNN, is a subset of deep learning and neural networks most


commonly used to analyze visual imagery.

• In machine learning, a convolution is the integral measurement of how two functions overlap as
they interact.

• A ConvNet usually has 3 types of layers:


1) Convolutional Layer (CONV)
2) Pooling Layer (POOL)
3) Fully Connected Layer (FC)
• Convolution

The main building block of CNN is the convolution layer. Convolution is a mathematical
operation to merge two sets of information.

• Pooling

After a convolution operation we usually perform pooling to reduce the dimensionality.

• Fully Connected

After the convolution + pooling layers we add a couple of fully connected layers to wrap up the
CNN architecture.

dense layer

A dense layer, also referred to as a fully connected layer, is a layer that is used in the final stages of the
neural network. This layer helps in changing the dimensionality of the output from the preceding layer
so that the model can easily define the relationship between the values of the data in which the model
is working¹.

Loss functions

Loss functions are mathematical objects that measure how often a model makes an incorrect prediction.
In the context of classification, they measure how often a model misclassifies members of different
groups. The most popular loss functions for deep learning classification models are binary cross-entropy
and sparse categorical cross-entropy².

One Shot learning

One Shot learning is a machine learning algorithm that requires very little data to identify or access the
similarities between objects. These are more helpful in deep learning models. One Shot learning is an
extreme form of few-shot learning where the model must learn a new class from a single example .

Long Short-Term Memory (LSTM)

Long Short-Term Memory (LSTM) networks are a type of recurrent neural network capable of learning
order dependence in sequence prediction problems. This is a behavior required in complex problem
domains like machine translation, speech recognition, and more. LSTMs are a complex area of deep
learning¹.
A common LSTM unit is composed of a cell, an input gate, an output gate and a forget gate. The cell
remembers values over arbitrary time intervals and the three gates regulate the flow of information into
and out of the cell².

A Markov Decision Process (MDP)

A Markov Decision Process (MDP) is a mathematical framework that models a sequential decision-
making problem in which an agent interacts with an environment. The environment is modeled as a set
of states, and the agent’s actions can transition it from one state to another. The agent’s goal is to
maximize some notion of cumulative reward over time¹.

• Reinforcement Learning is a type of Machine Learning. It allows machines and software agents
to automatically determine the ideal behaviour within a specific context, in order to maximize
its performance. Simple reward feedback is required for the agent to learn its behaviour; this is
known as the reinforcement signal.

• Reinforcement Learning is defined by a specific type of problem, and all its solutions are classed
as Reinforcement Learning algorithms. MDP is a framework that can solve most Reinforcement
learning problems. In the problem, an agent is supposed to decide the best action to select
based on his current state. When this step is repeated, the problem is known as a Markov
Decision Process (MDP).

A Markov Decision Process (MDP) model contains:

• A set of possible world states S.

• A set of Models.

• A set of possible actions A.

• A real valued reward function R(s,a).

• A policy the solution of Markov Decision Process.

• A State is a set of tokens that represent every state that the agent can be in.

• A Model (sometimes called Transition Model) gives an action’s effect in a state.

• An Action A is set of all possible actions. A(s) defines the set of actions that can be taken being in
state S.

• A Reward is a real-valued reward function.

A Policy is a solution to the Markov Decision Process.


Q-learning

Q-learning is a model-free reinforcement learning algorithm to learn the value of an action in a


particular state. It does not require a model of the environment (hence "model-free"), and it can handle
problems with stochastic transitions and rewards without requiring adaptations¹.

Q-Learning is a basic form of Reinforcement Learning which uses Q-values (also called action values) to
iteratively improve the behaviour of the learning agent.

SARSA (State-Action-Reward-State-Action)

SARSA (State-Action-Reward-State-Action) is a reinforcement learning algorithm that is used to learn a


policy for an agent interacting with an environment. It is a type of on-policy algorithm, which means that
it learns the value function and the policy based on the actions that are actually taken by the agent¹.

• State–action–reward–state–action(SARSA) algorithm is a slight variation of the popular Q-


Learning algorithm.

• SARSA is an algorithm for learning a Markov decision process policy, used in the reinforcement
learning area of machine learning.

• A learning agent in any Reinforcement Learning algorithm it’s policy can be of two types:-

• On Policy: In this, the learning agent learns the value function according to the current action
derived from the policy currently being used.
• Off Policy: In this, the learning agent learns the value function according to the action derived
from another policy.

Support Vector Machine (SVM)

Support Vector Machine (SVM) is a supervised machine learning algorithm that can be used for
classification and regression tasks. The main idea behind SVM is to find the best boundary (or
hyperplane) that separates the data into different classes².

Bayesian Learning

Bayesian Learning is a subset of probabilistic machine learning approaches that makes use of Bayes’
theorem to draw inferences from data. Bayesian inference can be used in Bayesian machine learning to
predict the weather with more accuracy, recognize emotions in speech, estimate gas emissions, and
much more⁵.

Natural Language Processing (NLP)

Natural Language Processing (NLP) is a subfield of linguistics, computer science, and artificial intelligence
that uses algorithms to interpret and manipulate human language. This technology is one of the most
broadly applied areas of machine learning and is critical in effectively analyzing massive quantities of
unstructured, text-heavy data³.

Reinforcement Learning

• Reinforcement Learning is defined as a Machine Learning method that is concerned with how
software agents should take actions in an environment.
• Reinforcement Learning is a feedback-based Machine learning technique in which an agent
learns to behave in an environment by performing the actions and seeing the results of actions.
For each good action, the agent gets positive feedback, and for each bad action, the agent gets
negative feedback or penalty.

• There is no supervisor, only a real number or reward signal.

• In Reinforcement Learning, the agent learns automatically using feedbacks without any labelled
data.

• The agent learns with the process of hit and trial, and based on the experience, it learns to
perform the task in a better way. Hence, we can say that "Reinforcement learning is a type of
machine learning method where an intelligent agent (computer program) interacts with the
environment and learns to act.“

The agent learns that what actions lead to positive feedback or rewards and what
actions lead to negative feedback penalty. As a positive reward, the agent gets a
positive point, and as a penalty, it gets a negative point.

Here are some important terms used in Reinforcement Learning:

• Agent: It is an assumed entity which performs actions in an environment to gain some reward.

• Environment (e): A scenario that an agent has to face.

• Reward (R): An immediate return given to an agent when he or she performs specific action or
task.

• State (s): State refers to the current situation returned by the environment.
• Policy (π): It is a strategy which applies by the agent to decide the next action based on the
current state.

• Value (V): It is expected long-term return with discount, as compared to the short-term reward.

• Value Function: It specifies the value of a state that is the total amount of reward. It is an agent
which should be expected beginning from that state.

• Model of the environment: Used to do planning , instead of hit and trial.

Types of Reinforcement Learning

Two kinds of reinforcement learning methods are:

I. Positive:

• The positive reinforcement learning means adding something to increase the tendency that
expected behaviour would occur again. It impacts positively on the behaviour of the agent and
increases the strength of the behaviour .

• This type of reinforcement can sustain the changes for a long time.

II. Negative:

• The negative reinforcement learning is opposite to the positive reinforcement as it increases the
tendency that the specific behaviour will occur again by avoiding the negative condition.

• It can be more effective than the positive reinforcement depending on situation and behaviour ,
but it provides reinforcement only to meet minimum behaviour.

Applications of Reinforcement Learning

• Robotics for industrial automation, Business strategy planning , Data processing, Aircraft
control , robot motion control etc.

DATA PREPROCESSING
What is Data Pre-processing?
Data pre-processing is a process of preparing the raw data and making it suitable
for a machine learning model.
Data Pre-processing includes the steps we need to follow to transform or encode
data so that it may be easily parsed by the machine. 
The main agenda for a model to be accurate and precise in predictions is that the
algorithm should be able to easily interpret the data's features. 

 4 Steps in Data Pre-processing 


I. Data Cleaning
The data cleaning process involves dealing with missing data and inconsistencies
in the data. It also includes the duplicate check and noisy data treatment.

Data Cleaning is particularly done as part of data pre-processing to clean the data
by filling missing values, smoothing the noisy data, resolving the inconsistency,
and removing outliers.

1. Missing values
2. Noisy Data
3. Removing outliers

II. Data Integration


Data integration is all about combining data from different sources to form a
consistent and stable dataset for your analysis.
Data Integration is one of the data pre-processing steps that are used to merge the
data present in multiple sources into a single larger data store like a data
warehouse.

III. Data Transformation


The data transformation step includes data normalization. It means, to make sure
data is not redundant and falls on the same scale.

1. Generalization
2. Normalization
3. Aggregation

IV. Data Reduction / Dimensionality Reduction


Some of the databases are massive and became slow to load. So we can reduce the
data by taking the subset with relevant attributes.

The size of the dataset in a data warehouse can be too large to be handled by data
analysis and data mining algorithms. One possible solution is to obtain a reduced
representation of the dataset that is much smaller in volume but produces the same
quality of analytical results.
Padding
• Padding is used in CNN to preserve the size of feature maps.

• If we take a neural net with 100’s of layers, it will give us a small image after filtered in the end.
So there are the two main downsides of applying filters:

I. Shrinking outputs

II. Loosing information on corners of the image

• If we want to maintain the same dimensionality, we use padding to surround the input with
zeros. 
Stride
• Stride specifies how much we move the convolution filter at each step.

• In other words, Stride is the number of pixels shifts over the input matrix.

• Stride controls how the filter convolves around the image volume.

Pooling
• Pooling layer is a building block of CNN. Its function is to progressively reduce the size of
representation to reduce the amount of parameters and computation in network.

• Pooling layer operates on each feature map independently.

• Types of Pooling :

i. Max Pooling

ii. Average Pooling

• Sliding a window, we only take the maximum value inside the box on the left case. This is ‘max
pooling.’

• We can also take the average values like the picture on the right. This is ‘average pooling.’ 

You might also like