Machine Learning _ Introduction
Machine Learning _ Introduction
Introduction
1
Topics to be discussed
Introduction
Statistical Learning
Supervised Learning 2
Unsupervised Learning
Reinforcement Learning
Probability basics
● Learning : A computer program is
said to learn from experience E
with respect to some class of
tasks T and performance measure
P, if its performance at tasks in T,
as measured by P, improves with
INTRODUCTION experience E.
Examples -
Handwriting recognition learning
problem
A robot driving learning problem
3
Machine learning
“The field of study that gives
computers the ability to learn
without being explicitly
programmed.” - Arthur samuel,1959-
IBM USA
4
How does ML works ?
1. A Decision Process: In general, machine learning algorithms are used to
make a prediction or classification. Based on some input data, which can
be labeled or unlabeled, your algorithm will produce an estimate about a
pattern in the data.
2. An Error Function: An error function evaluates the prediction of the
model. If there are known examples, an error function can make a
comparison to assess the accuracy of the model.
3. A Model Optimization Process: If the model can fit better to the data
points in the training set, then weights are adjusted to reduce the discrepancy
between the known example and the model estimate. The algorithm will repeat
this “evaluate and optimize” process, updating weights autonomously until a
threshold of accuracy has been met.
5
Statistics and Machine Learning
● Statistics is the mathematical study of data. Using statistics, an
interpretable statistical model is created to describe the data, and
this model can then be used to infer something about the data or
even to predict values that are not present in the sample data used
to create the model.
● The ‘accuracy’ of prediction is not the focus of statistics.
● To avoid overfitting the data using machine learning methods, and
indeed often in statistics, the observed data set is tested by
separating out a portion of the data (known as the test set) to
confirm the strength of the model built by the majority of the data
(known as the training set). Often, a validation set within the training
set is used to determine the validity of the predictive model before
it’s confirmed on the test data set.
6
ML Algorithms :
● Neural networks: Neural networks simulate the way the human brain
works, with a huge number of linked processing nodes. Neural
networks are good at recognizing patterns and play an important
role in applications including natural language translation, image
recognition, speech recognition, and image creation.
● Linear regression: This algorithm is used to predict numerical
values, based on a linear relationship between different values. For
example, the technique could be used to predict house prices based
on historical data for the area.
● Logistic regression: This supervised learning algorithm makes
predictions for categorical response variables, such as“yes/no”
answers to questions. It can be used for applications such as
classifying spam and quality control on a production line.
7
ML Algorithms :
● Clustering: Using unsupervised learning, clustering algorithms can
identify patterns in data so that it can be grouped. Computers can help
data scientists by identifying differences between data items that
humans have overlooked.
● Decision trees: Decision trees can be used for both predicting numerical
values (regression) and classifying data into categories. Decision trees
use a branching sequence of linked decisions that can be represented
with a tree diagram. One of the advantages of decision trees is that they
are easy to validate and audit, unlike the black box of the neural
network.
● Random forests: In a random forest, the machine learning algorithm
predicts a value or category by combining the results from a number of
decision trees.
8
Ml use cases
Speech recognition: It is also known as automatic speech recognition (ASR),
computer speech recognition, or speech-to-text, and it is a capability which uses natural
language processing (NLP) to translate human speech into a written format. Many
mobile devices incorporate speech recognition into their systems to conduct voice
search—e.g. Siri—or improve accessibility for texting.
Customer service: Customer service: Online chatbots are replacing human agents along
the customer journey, changing the way we think about customer engagement across
websites and social media platforms. Chatbots answer frequently asked questions (FAQs)
about topics such as shipping, or provide personalized advice, cross-selling products or
suggesting sizes for users. Examples include virtual agents on e-commerce sites;
messaging bots, using Slack and Facebook Messenger; and tasks usually done by virtual
assistants and voice assistants.
Ml use cases
Computer vision: This AI technology enables computers to derive meaningful information from
digital images, videos, and other visual inputs, and then take the appropriate action. Powered by
convolutional neural networks, computer vision has applications in photo tagging on social media,
radiology imaging in healthcare, and self-driving cars in the automotive industry.
Recommendation engines: Using past consumption behavior data, AI algorithms can help to
discover data trends that can be used to develop more effective cross-selling strategies. This
approach is used by online retailers to make relevant product recommendations to customers
during the checkout process.
Automated stock trading: Designed to optimize stock portfolios, AI-driven high-frequency trading
platforms make thousands or even millions of trades per day without human intervention.
Fraud detection: Banks and other financial institutions can use machine learning to spot
suspicious transactions. Supervised learning can train a model using information about known
fraudulent transactions. Anomaly detection can identify transactions that look atypical and deserve
further investigation.
Supervised learning
It is defined by its use of labeled datasets to train algorithms that to classify data or predict
outcomes accurately.
As input data is fed into the model, it adjusts its weights until the model has been fitted
appropriately, which occurs as part of the cross validation process. Supervised learning helps
organizations solve for a variety of real-world problems at scale, such as classifying spam in a
separate folder from your inbox.
How it works :
Supervised learning uses a training set to teach models to yield the desired output. This training
dataset includes inputs and correct outputs, which allow the model to learn over time. The
algorithm measures its accuracy through the loss function, adjusting until the error has been
sufficiently minimized.
Supervised learning can be separated into two types of problems when data
mining—classification and regression:
Supervised learning
Classification uses an algorithm to accurately assign test data into specific categories. It
recognizes specific entities within the dataset and attempts to draw some conclusions on how
those entities should be labeled or defined. Common classification algorithms are linear
classifiers, support vector machines (SVM), decision trees, k-nearest neighbor, and random
forest.
Source : https://www.ibm.com/cloud/learn/neural-networks
NAIVE BAYES
Naive Bayes is classification approach that adopts the principle of class
conditional independence from the Bayes Theorem.
This means that the presence of one feature does not impact the presence of
another in the probability of a given outcome, and each predictor has an equal
effect on that result.
There are three types of Naïve Bayes classifiers: Multinomial Naïve Bayes,
Bernoulli Naïve Bayes, and Gaussian Naïve Bayes.
This technique is primarily used in text classification, spam identification, and
recommendation systems.
LINEAR REGRESSION
Linear regression is used to identify the relationship between a dependent variable
and one or more independent variables and is typically leveraged to make predictions
about future outcomes.
When there is only one independent variable and one dependent variable, it is known
as simple linear regression.
As the number of independent variables increases, it is referred to as multiple linear
regression.
For each type of linear regression, it seeks to plot a line of best fit, which is calculated
through the method of least squares. However, unlike other regression models, this
line is straight when plotted on a graph.
LOGISTIC REGRESSION
While linear regression is leveraged when dependent variables are
continuous, logistic regression is selected when the dependent variable
is categorical, meaning they have binary outputs, such as "true" and
"false" or "yes" and "no."
https://www.ibm.com/in-en/topics/knn
RANDOM FOREST
Random forest is another flexible supervised machine learning algorithm
used for both classification and regression purposes. The "forest" references
a collection of uncorrelated decision trees, which are then merged together
to reduce variance and create more accurate data predictions.
https://www.ibm.com/cloud/learn/random-forest
SUPERVISED LEARNING : EXAMPLES
● Image- and object-recognition: Supervised learning algorithms can be used to locate,
isolate, and categorize objects out of videos or images, making them useful when
applied to various computer vision techniques and imagery analysis.
● Predictive analytics: A widespread use case for supervised learning models is in
creating predictive analytics systems to provide deep insights into various business
data points. This allows enterprises to anticipate certain results based on a given
output variable, helping business leaders justify decisions or pivot for the benefit of
the organization.
● Customer sentiment analysis: Using supervised machine learning algorithms,
organizations can extract and classify important pieces of information from large
volumes of data—including context, emotion, and intent—with very little human
intervention. This can be incredibly useful when gaining a better understanding of
customer interactions and can be used to improve brand engagement efforts.
SUPERVISED LEARNING : EXAMPLES
● Clustering is a data mining technique which groups unlabeled data based on their
similarities or differences.
● Clustering algorithms are used to process raw, unclassified data objects into groups
represented by structures or patterns in the information.
● Clustering algorithms can be categorized into a few types, specifically exclusive,
overlapping, hierarchical, and probabilistic.
UNSUPERVISED LEARNING : Association rules
While more data generally yields more accurate results, it can also impact the performance of
machine learning algorithms (e.g. overfitting) and it can also make it difficult to visualize
datasets.
It reduces the number of data inputs to a manageable size while also preserving the integrity
of the dataset as much as possible.
It is commonly used in the preprocessing data stage, and there are a few different
dimensionality reduction methods that can be used, such as: Principal component analysis.
UNSUPERVISED LEARNING : Applications
● News Sections: Google News uses unsupervised learning to categorize articles on the
same story from various online news outlets. For example, the results of a presidential
election could be categorized under their label for “US” news.
● Computer vision: Unsupervised learning algorithms are used for visual perception tasks,
such as object recognition.
● Medical imaging: Unsupervised machine learning provides essential features to medical
imaging devices, such as image detection, classification and segmentation, used in
radiology and pathology to diagnose patients quickly and accurately.
● Anomaly detection: Unsupervised learning models can comb through large amounts of
data and discover atypical data points within a dataset. These anomalies can raise
awareness around faulty equipment, human error, or breaches in security.
UNSUPERVISED LEARNING : Applications