0% found this document useful (0 votes)
3 views9 pages

Ai Unit-4-1

The document provides an overview of learning, specifically focusing on machine learning (ML) as a subset of artificial intelligence that enables systems to learn from data. It details the classification of machine learning into supervised, unsupervised, reinforcement, and semi-supervised learning, with a particular emphasis on supervised learning, its algorithms, advantages, and disadvantages. Additionally, it discusses regression and classification models, decision trees, and the differences between classification and regression in machine learning.

Uploaded by

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

Ai Unit-4-1

The document provides an overview of learning, specifically focusing on machine learning (ML) as a subset of artificial intelligence that enables systems to learn from data. It details the classification of machine learning into supervised, unsupervised, reinforcement, and semi-supervised learning, with a particular emphasis on supervised learning, its algorithms, advantages, and disadvantages. Additionally, it discusses regression and classification models, decision trees, and the differences between classification and regression in machine learning.

Uploaded by

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

UNIT-4

Learning
"Learning" refers to the process by which a system improves its performance
on a task over time through experience, data, or interaction with the
environment.

Machine Learning:

Machine learning (ML) is a subset of artificial intelligence (AI) that focuses on


enabling computers to learn from data without explicit programming.

Machine learning (ML) is a branch of artificial intelligence (AI) focused on


enabling computers and machines to imitate the way that humans learn, to
perform tasks autonomously, and to improve their performance and accuracy
through experience and exposure to more data.

Machine learning is a branch of Artificial Intelligence that focuses on


developing models and algorithms that let computers learn from data.

Classification of Machine Learning

A. Supervised learning:
B. Unsupervised learning:
C. Reinforcement learning:
D. Semi-supervised learning:

Supervised learning:
Supervised learning, as the name indicates, has the presence of a supervisor as a
teacher. Basically supervised learning is when we teach or train the machine using
data that is well labelled. Which means some data is already tagged with the
correct answer. After that, the machine is provided with a new set of examples
(data) so that the supervised learning algorithm analyses the training data (set of
training examples) and produces a correct outcome from labelled data.
For instance, suppose you are given a basket filled with different kinds of fruits.
Now the first step is to train the machine with all the different fruits one by one like
this:
If the shape of the object is rounded and has a depression at the top, is red in color,
then it will be labeled as –Apple.
If the shape of the object is a long curving cylinder having Green-Yellow color, then
it will be labeled as –Banana

Since the machine has already learned the things from previous data and this time
has to use it wisely. It will first classify the fruit with its shape and colour and would
confirm the fruit name as BANANA and put it in the Banana category. Thus the
machine learns the things from training data (basket containing fruits) and then
applies the knowledge to test data (new fruit).

In supervised learning, the training data provided to the machines work as the
supervisor that teaches the machines to predict the output correctly. It applies the
same concept as a student learns in the supervision of the teacher.

Supervised learning is a process of providing input data as well as correct output


data to the machine learning model. The aim of a supervised learning algorithm is
to find a mapping function to map the input variable(x) with the output
variable(y).

In the real-world, supervised learning can be used for Risk Assessment, Image
classification, Fraud Detection, spam filtering, etc.

How Supervised Learning Works?


In supervised learning, models are trained using labelled dataset, where the model
learns about each type of data. Once the training process is completed, the model
is tested on the basis of test data (a subset of the training set), and then it predicts
the output.
The working of Supervised learning can be easily understood by the below example
and diagram:
Suppose we have a dataset of different types of shapes which includes square,
rectangle, triangle, and Polygon. Now the first step is that we need to train the
model for each shape.

 If the given shape has four sides, and all the sides are equal, then it will be
labelled as a Square.
 If the given shape has three sides, then it will be labelled as a triangle.
 If the given shape has six equal sides then it will be labelled as hexagon.

Now, after training, we test our model using the test set, and the task of the model is
to identify the shape.
The machine is already trained on all types of shapes, and when it finds a new
shape, it classifies the shape on the bases of a number of sides, and predicts the
output.
Steps Involved in Supervised Learning:
 First Determine the type of training dataset
 Collect/Gather the labelled training data.
 Split the training dataset into training dataset, test dataset, and validation
dataset.
 Determine the input features of the training dataset, which should have
enough knowledge so that the model can accurately predict the output.
 Determine the suitable algorithm for the model, such as support vector
machine, decision tree, etc.
 Execute the algorithm on the training dataset. Sometimes we need
validation sets as the control parameters,which are the subset of training
datasets.
 Evaluate the accuracy of the model by providing the test set. If the model
predicts the correct output, which means our model is accurate.

Types of supervised Machine learning Algorithms:


Regression
Regression algorithms are used if there is a relationship between the input variable
and the output variable. It is used for the prediction of continuous variables, such as
Weather forecasting, Market Trends, etc. Below are some popular Regression
algorithms which come under supervised learning:

 Linear Regression
 Regression Trees
 Non-Linear Regression
 Bayesian Linear Regression
 Polynomial Regression

Classification
Classification algorithms are used when the output variable is categorical, which
means there are two classes such as Yes-No, Male-Female, True-false, etc.

 Random Forest
 Decision Trees
 Logistic Regression
 Support vector Machines

Advantages of Supervised learning:


 With the help of supervised learning, the model can predict the output on the
basis of prior experiences.
 In supervised learning, we can have an exact idea about the classes of objects.
 Supervised learning model helps us to solve various real-world problems such
as fraud detection, spam filtering,etc.

Disadvantages of supervised learning:


 Supervised learning models are not suitable for handling the complex tasks.
 Supervised learning cannot predict the correct output if the test data is
different from the training dataset.
 Training required lots of computation times.
 In supervised learning, we need enough knowledge about the classes of
object.
Classification vs Regression in Machine Learning

Regression and Classification with Linear Models:

Linear regression is a statistical method used to model the relationship


between a dependent variable and one or more independent variables. It
provides valuable insights for prediction and data analysis.

Types of Regression Models:

1. Simple Linear Regression:


Assume that there is only one independent variable x. If the
relationship between x (independent variable) and y
(dependent variable) is modelled by the relation,
Y=a+bx
The regression model is called linear regression model.
2. Multiple Regressions:
Assume that there are multiple independent variables say
x1,x2,.......xn.If the relationship between independent variables x and
dependent or output variable y is modelled by the relation,
Y=a0+a1*x1+a2*x2+.......+an*xn

3. Polynomial Regression:
Assume that there is only one independent variable x. If the
relationship between x (independent variable) or y (dependent variable)
is modelled by the relation,
Y=a0+a1*x1+a2*x2+.......+an*xn
For some positive integer n>1, then we have a Polynomial Regression.

4. Logistic Regression:
Logistic Regression is used when the dependent variable is
Binary (0/1, True/False, Yes/No) in nature.

Types of classification Models:


1. Decision Tree Classification: Builds a tree where each node
represents a test case for an attribute, and branches represent
possible outcomes.
2. Random Forest Classification : Uses an ensemble of decision trees
to make predictions, improving accuracy by averaging the results from
multiple trees.
3. K-Nearest Neighbor (KNN): Classifies data points based on the ‘k’
nearest neighbors using feature similarity.

Decision Boundary vs Best-Fit Line:

It is an surface or line that separates data points into different


classes in a feature space. It can be linear (a straight line) or non-
linear (a curve), depending on the complexity of the data and the
algorithm used. For example:
 A linear decision boundary might separate two classes in a 2D space
with a straight line (e.g., logistic regression).
 A more complex model, may create non-linear boundaries to better fit
intricate datasets.

Best-Fit Line in Regression


In regression, a best-fit line (or regression line) represents the
relationship between independent variables (inputs) and a dependent
variable (output). It is used to predict continuous numerical values
capturing trends and relationships within the data, allowing for accurate
predictions of continuous variables. The best-fit line can be linear or non-
linear:
 A straight line is used for linear regression.
 Curves are used for more complex regressions, like polynomial
regression
Difference between Classification and Regression

Classification Regression

In this problem statement, the


target variables are discrete. Continuous numerical value (e.g.,
Discrete categories (e.g., “spam” or price, temperature).
“not spam”)

To predict which category a data To predict an exact numerical value


point belongs to. based on input data.

Email spam detection, image


House price prediction, stock market
recognition, customer sentiment
forecasting, sales prediction.
analysis.

Evaluation metrics like Precision, Mean Squared Error, R2-


Recall, and F1-Score Score, , MAPE and RMSE.

Clearly defined boundaries No distinct boundaries, focuses on


between different classes. finding the best fit line.

Linear Regression, Polynomial


Logistic regression, Decision trees,
Regression, Decision Trees (with
Support Vector Machines (SVM)
regression objective).

Decision Trees:
A decision tree is a category of supervised learning and it is a graphical
representation of different options for solving a problem and show how
different factors are related. It has a hierarchical tree structure starts with
one main question at the top called a node which further branches out into
different possible outcomes where:

 Root Node is the starting point that represents the entire dataset.
 Branches: These are the lines that connect nodes. It shows the flow
from one decision to another.
 Internal Nodes are Points where decisions are made based on the
input features.
 Leaf Nodes: These are the terminal nodes at the end of branches that
represent final outcomes or predictions.
Let’s take an example to understand the decision tree. Imagine you want
to decide whether to drink coffee based on the time of day and how tired
you feel. First the tree checks the time of day—if it’s morning it asks
whether you are tired. If you’re tired the tree suggests drinking coffee if
not it says there’s no need. Similarly in the afternoon the tree again asks if
you are tired. If you recommends drinking coffee if not it concludes no
coffee is needed.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy