0% found this document useful (0 votes)
7 views

Machine Learning

Machine learning is a subset of Artificial Intelligence that enables machines to make predictions based on data without explicit programming. Supervised machine learning uses labeled datasets to train models through classification and regression methods, allowing machines to recognize patterns and predict outcomes. Applications of supervised machine learning include facial recognition, spam detection, healthcare, and marketing trend analysis.

Uploaded by

ayirfan33301
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Machine Learning

Machine learning is a subset of Artificial Intelligence that enables machines to make predictions based on data without explicit programming. Supervised machine learning uses labeled datasets to train models through classification and regression methods, allowing machines to recognize patterns and predict outcomes. Applications of supervised machine learning include facial recognition, spam detection, healthcare, and marketing trend analysis.

Uploaded by

ayirfan33301
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Machine Learning:

Machine learning is a subset of Artificial Intelligence which circulates various


algorithms and statistical models. It usually involves learning of a machine
through data which is then used to make predictions. In other words, a machine
can be trained to perform tasks without “explicit programming”

What is explicit programming?


Explicit programming is a technique that involves specifying what u want your
code to do. The machine trained by explicit coding can't infer or assume
anything on its own. As all the quantities and necessary parameters have been
defined by the owner. The machine does not contain any intelligent features as
you are just telling the computer what to do.
Apart from explicit programming, machine learning usually introduces the
concepts of training based on pattern recognition and by instilling a capability of
decision-making in the machines based on the previous data prompts provided in
training.
Machine learning is widely used in various computer-related fields such as
robotics and natural language processing.

Supervised Machine Learning:


Supervised machine learning is a paradigm of machine learning where a labelled
data set is used to train appliances using various algorithms to predict outcomes
and recognize patterns, A Labelled data set refers to a large data collection that
contains both inputs and correct outputs, The algorithm learns and understand
the relationships between the input and outputs of the data set provided and
applied these concepts to other real-world problems.
Supervised learning involves three basic steps:
Data collection
Training
Testing
Training can be done by two specific methods:

1)Classification:
Classification is a training method in which the model compares key
characteristics of the new data with the previous information set and classifies
them in groups and subdivisions.

Algorithms:
K nearest neighbours:
One of the well-recognized classification algorithms used the concept of
proximity and similarity to make predictions and classifications of an individual in
grouped data.
KNN algorithm follows the following steps:
Step 1: Calculate the Euclidean Distances
Step 2: Find the K nearest neighbours
Step 3: Consider the majority

General Explanation:
First, the Euclidean distances are calculated for the specific aspect with all other
features of the data set. Then we consider a variable K which represents the
number of neighbours to be considered. In other words, the value of K tells us
the number of comparisons to be made. The minimum (closest) values are
always considered. After significant comparisons, the class is determined.

Example:
In the given example I used K nearest neighbour to determine the genre of the
recently released movie BARBIE.

Step 1: Calculating the distances by using The Euclidean Distance Formula

Step 2: Finding K nearest neighbours:


If K is considered to be one, it means only one neighbour is taken into
consideration. Next, find out the neighbour rearing lowest value. In this case, it is
the fourth distance which is 41. Then go back to the table and note the genre of
that movie. The movie is OMG 2 having a genre of comedy. Hence by K Nearest
Neighbour approach the movie BARBIE falls in the category of Comedy as well.

Step 3: Considering the majority:


This step is considered when the value of K is considered greater than 1. After
finding out the required neighbours and observing their respective classes, the
class that appears most frequently in the list is considered our desired class
In the former example, If k=3, then the 3 nearest neighbours would have been
41,46,54 corresponding to Mission Impossible, Rocky Rani and OMG 2
Enlisting their mentioned genres:
Action, Comedy, Comedy
As Comedy prevails more frequently than Action therefore, comedy is considered
the final genre of our movie under consideration (BARBIE).
Note: This is quite an ideal scenario, real life problems are more dynamic
involving much more variables and a larger data set. It is advisable to consider at
least 5 nearest neighbours before making significant comparisons.

2) Regression:
The second type of testing involves regression. Regression uses a statistical
approach to predict and define the relationship between variables. In other
words, Regression involves numerical procedures that help us understand how
the behaviour of variables changes by changing their values.
Variable is any quantity that is taken into consideration not having a fixed value.
Variables are changeable and adaptable

Variable are of two types:


Independent Variable: it varies freely, change in its value does not affect
any other variables

Dependant Variable: value is dependent on independent and other


variables

Linear Regression:
It is a model that helps us estimate the relationship between variables. As the
word linear suggests, this model follows the basic formula of slope-intercept form
for linear equations often represented by:
Y=mx+b
Where m is the slope and b represents the y-intercept

General Explanation:
The process of linear regression involves many basic mathematical concepts,
Forst raw data is collected for both of the variables x and y and then the mean of
x and y are calculated, After the calculation of respective means the
corresponding deviations are calculated, by subtracting the original values of
variables by their means, After obtaining deviation of both the variables take the
product of these deviations, sum the deviations and square the deviations of the
dependant variable(x)
After calculating all these values and completing your table, the slope can be
calculated as follows:
M=Sum of Product deviations/ Sum of Square of deviations of x
After calculating the slope the y-intercept can be calculated as follows :
b=Mean of y-(slope*Mean of x)
After all these factors can be calculated, any prediction can be made by using
the simple slope-intercept form.

X Y Mea Mea Deviatio Deviatio Product Sum of Squar


value value nX nY ns of X ns of Y of Product e of
s s Deviatio of dev
ns Deviatio of x
ns

The table will have a basic format like this

Example:
We want to train a model to predict the pizza prices based on the diameter of the
pizza by linear regression. It can be done as follows;

m =Sum of product deviations/Sum of square of deviations for x


m=12/8=1.5
Calculate b=Mean of Y-(m*mean of x)
b=13-(1.5*10)
b=-2
For example: If a customer wants to know the price for a pizza having a diameter
of 20 inches, we can calculate the price as follows:
Y=mx+b
Y=1.5*20+(-2)
Y(price)=$28
Note: This is quite an ideal scenario, real life problems are more dynamic
involving much more variables and a larger data set. In this case, the graph is
linear as the data is limited and pretty basic whereas real-life cases may have
scattered data due to external factors and outliers( a data point having quite a
different value compared to the remaining data set).

Training:
After applying a suitable training algorithm , the model is tested by providing
similar questions as in the data set and learning accuracy is determined.

Advantages:
Machines and appliances trained by supervised machine learning algorithms
have higher accuracy and success rates as the model is trained many times with
similar data sets that increase precision and accuracy.

Applications:
Supervised Machine Learning is often used in facial recognition systems, spam
email detection systems, healthcare, and predictive analysis of trends in
marketing.

You might also like