0% found this document useful (0 votes)
26 views31 pages

DSOST3

Machine learning (ML) is a branch of artificial intelligence that enables computers to learn from data and make predictions. It includes three main types: supervised learning, unsupervised learning, and reinforcement learning, each with distinct methodologies and applications. The document also discusses the importance of training, validation, and test datasets in model evaluation and tuning, along with concepts like learning curves, overfitting, and regularization strategies.

Uploaded by

229x1a3250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views31 pages

DSOST3

Machine learning (ML) is a branch of artificial intelligence that enables computers to learn from data and make predictions. It includes three main types: supervised learning, unsupervised learning, and reinforcement learning, each with distinct methodologies and applications. The document also discusses the importance of training, validation, and test datasets in model evaluation and tuning, along with concepts like learning curves, overfitting, and regularization strategies.

Uploaded by

229x1a3250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Unit-3

Machine Learning
Introduction
Machine learning (ML) is a subset of artificial
intelligence (AI) that focuses on developing algorithms
that allow computers to learn from data and make
decisions or predictions without being explicitly
programmed.

It involves training models using large amounts of data


so they can detect patterns, recognize trends, and
improve over time based on new inputs.
There are three main types of machine learning:

Supervised Learning
Unsupervised Learning
Reinforcement Learning
Supervised Learning:
The model is trained on labeled data, where the correct
output is already known.

The goal is to map input data to the correct output (e.g.,


predicting house prices based on features like square
footage).
Unsupervised Learning: The model is given data
without labels and must find hidden patterns or
structures on its own (e.g., clustering customers based
on purchasing behavior).
Reinforcement Learning: The model learns by
interacting with an environment and receiving feedback
in the form of rewards or penalties, which helps it
optimize its actions over time (e.g., training a robot to
navigate a maze).
Supervised Learning
Introduction
Machine learning involves coding programs that
automatically adjust their performance in accordance
with their exposure to information in data
Supervised learning: Algorithms which learn from a
training set of labeled examples (exemplars) to
generalize to the set of all possible inputs.
Examples of techniques in supervised learning: logistic
regression, support vector machines, decision trees, random
forest, etc.

Unsupervised learning: Algorithms that learn from a


training set of unlabeled examples. Used to explore data
according to some statistical, geometric or similarity
criterion.

Examples of unsupervised learning include k-means


clustering and kernel density estimation.
Reinforcement learning:

Algorithms that learn via reinforcement from criticism


that provides information on the quality of a solution,
but not on how to improve it.

Improved solutions are achieved by iteratively


exploring the solution space.
Learning Curves
A learning curve is a graphical representation of how a
model's performance improves as it is exposed to more
training data or as it goes through more iterations of
training.

Learning curves are helpful for understanding how


well a model is learning and diagnosing issues like
overfitting or underfitting.
There are typically two types of learning curves in
supervised learning:
Training Error Curve: Shows how the error (or loss)
of the model changes as more training data or iterations
are used.

Ideally, this curve should decrease as the model learns


more about the data.
Validation Error Curve: Shows how the model’s
error behaves on a separate validation set that it hasn’t
seen during training.

This curve is crucial for detecting overfitting. If the


training error decreases while the validation error starts
increasing, it indicates overfitting.
Underfitting (High Training and Validation Error):
This happens when the model is too simple (e.g., using
too few features or too simple of a model like a linear
regression for a non-linear problem).
Overfitting (Low Training Error, High Validation
Error):
The model becomes too complex and starts to
memorize the training data, capturing noise instead of
general patterns.
The value both errors converge towards is also called
the bias; and the difference between this value and the
test error is called the variance.
The bias/variance decomposition of the learning curve
is an alternative approach to the training and
generalization view.
A good heuristic for selecting the model is to choose
the value of the hyperparameters that yields the
smallest estimated test error.

We may also change the formulation of the objective


function to penalize complex models. This is called
regularization. Regularization accounts for estimating
the value of Ω in our out-of-sample error inequality.
This usually becomes implicit in the algorithm but has
huge consequences in real applications.
The most common regularization strategies are as
follows:
L2 weight regularization: Adding an L2 penalization
term to the weights of a weight-controlled model
implies looking for solutions with small weight values.
L1 weight regularization: Adding an L1 regularization
term forces sparsity in the weights of the model.
These terms are added to the objective function.
Thus, we still have to select this parameter by means of
model selection.
Training,Validation and Test
The concepts of training, validation, and test datasets
are essential to properly evaluate and tune models.
To select a model and control its complexity according
to the number of training data.
Selecting the best hyperparameters as choosing the
classifier with parameters that performs the best.
Select a set of hyperparameter values and use
cross-validation to select the best configuration. The
process of selecting the best hyperparameters is called
validation.

This introduces a new set into our simulation scheme;


we now need to divide the data we have into three sets:
training, validation, and test sets.
The process of assessing the performance of the
classifier by estimating the generalization error is called
testing.

And the process of selecting a model using the


estimation of the generalization error is called
validation.
Test data is used exclusively for assessing performance
at the end of the process and will never be used in the
learning process.

Validation data is used explicitly to select the


parameters/models with the best performance according
to an estimation of the generalization error. This is a
form of learning.
Training data are used to learn the instance of the model
from a model class.

Training ensures that the model learns from data.

Validation helps in model selection and hyperparameter


tuning, ensuring that the model generalizes well and avoids
overfitting.

Testing provides a final, unbiased performance assessment,


allowing you to estimate how the model will perform on
real-world data.
Given training data, and in the most general case we
explicitly have to tune some hyperparameter. Select the
different splits

To provide the best model, then we may use


cross-validation on our training dataset and select the
model with the best performance.
A practical issue: once we have selected the model, we
use the complete training set to train the final model.
Thus, we may proceed in the following way:
1.Split the original dataset into training and test data.
For example, use 30% of the original dataset for testing
purposes. This data is held back and will only be used
to assess the performance of the method.
2.Use the remaining training data to select the
hyperparameters by means of crossvalidation.
3. Train the model with the selected parameter and
assess the performance using the test dataset.
Learning Models

You might also like