SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Machine
Learning
Engr.Muhammad Suleman Memon
Assistant Professor & HoD
Department of Information Technology
Email: engrsuleman14@gmail.com
Cell#: 923332941065
What is Machine Learning
Machine learning is a segment of artificial intelligence.
It is designed to make computers learn by themselves and perform operations without
human intervention.
It means a computer or a system designed with machine learning will identify, analyse
and change accordingly and give the expected output when it comes across a new
pattern of data, without any need of humans.
How Machine
Learning Works?
Examples of Machine
Learning
Machine Learning – Methods
SUPERVISED
LEARNING
UNSUPERVISED
LEARNING
SEMI-SUPERVISED
LEARNING
REINFORCEMENT
LEARNING
Machine Learning – Algorithms
Neural
networks
Decision trees
Random
forests
Support vector
machines
Nearest-
neighbor
mapping
k-means
clustering
Self-organizing
maps
Expectation
maximization
Bayesian
networks
Kernel density
estimation
Principal
component
analysis
Singular value
decomposition
Machine Learning
Tools and Libraries
Which Industries Use
Machine Learning?
â–Ș Pharmaceuticals
â–Ș Banks and Financial Services
â–Ș Health Care and Treatments
â–Ș Online Sales
â–Ș Mining, Oil and Gas
â–Ș Government Schemes
Linear Regression
in Machine
Learning
Linear Regression is an algorithm that belongs to
supervised Machine Learning.
It tries to apply relations that will predict the
outcome of an event based on the independent
variable data points.
The relation is usually a straight line that best
fits the different data points as close as possible.
The output is of a continuous form, i.e., numerical
value. For example, the output could be revenue
or sales in currency, the number of products sold,
etc.
Linear Regression
Equation
Linear regression can be
expressed mathematically as:
y= ÎČ0+ ÎČ 1x+ Δ
Y= Dependent Variable
X= Independent Variable
ÎČ 0= intercept of the line
ÎČ1 = Linear regression
coefficient (slope of the line)
Δ = random error
Types of Linear Regression
Simple
Linear
Regression
Multiple
Linear
Regression
Non-Linear
Regression
Simple Linear Regression
A simple straight-line
equation involving slope
(dy/dx) and intercept (an
integer/continuous value)
is utilized in simple Linear
Regression.
y=mx+c where y denotes
the output, x is the
independent variable, and
c is the intercept when
x=0.
Multiple Linear
Regression
â–Ș When a number
of independent variables are
more than one, the governing
linear equation applicable to
regression takes a different
form like:
â–Ș y=
c+m1x1+m2x2
 mnxn where
represents the coefficient
responsible for impact of
different independent
variables x1, x2 etc.
Non-Linear Regression
â–Ș When the best fitting line is not a straight line but a curve, it is referred to
as Non-Linear Regression.
Advantages of Linear
Regression
For linear datasets, Linear Regression performs well to find the nature of the relationship
among different variables.
Linear Regression algorithms are easy to train and the Linear Regression models are easy
to implement.
Although, the Linear Regression models are likely to over-fit, but can be avoided using
dimensionality reduction techniques such as regularization (L1 and L2) and cross-
validation.
Disadvantages of Linear Regression
An important disadvantage of Linear
Regression is that it assumes
linearity between the dependent and
independent variables, which is rarely
represented in real-world data. It
assumes a straight-line relationship
between the dependent and
independent variables, which is
unlikely many times.
It is prone to noise and overfitting. In
datasets where the number of
observations is lesser than the
attributes, Linear Regression might
not be a good choice as it can lead
to overfitting. This is because the
algorithm can start considering the
noise while building the model.
Key Benefits of Linear Regression
Easy to Implement
Scalability
Interpretability
Applicability in real-time
Use Cases of Linear
Regression
➱ Agriculture
➱ Banking
➱ Finance
➱ Education
➱ Marketing
Agriculture
â–Ș Can be used to predict the amount of rainfall and crop yield.
Banking
â–Ș it is implemented to predict probability of loan defaults.
Finance sector
â–Ș used to predict stock prices and assess associated risks.
Healthcare Sector
â–Ș Helpful in modelling the healthcare costs, predicting the length of stay in
hospitals for patients.
Sports analytics
â–Ș Can be used to predict the performance of players in upcoming games.
Similarly
Education
â–Ș Can be used in education to predict student performances
in different courses.
Business
â–Ș To forecast product demands, predict product sales, decide on marketing
and advertising strategies, and so on.
Best Practices for Linear
Regression
1. Follow the Assumptions
2. Start with a Simple Model First
3. Use Visualizations
4. Start with Sample Dataset
5. Shifting to Multi-Linear Regression
6. Applying Linear Regression Model to Real-life Problems
7. Choosing Appropriate Data
Frequently Asked Questions (FAQs)
1. What is the output
of Linear Regression
in machine learning?
2. What are the
benefits of using
Linear Regression?
3. How do you
explain a Linear
Regression model?
4. Which type of
dataset is used for
Linear Regression?
5. Which ML model is
best for regression?
Logistic
Regression
Logistic Regression is a popular statistical model used for binary
classification, that is for predictions of the type this or that, yes or no, A
or B, etc.
Logistic regression can, however, be used for multiclass classification.
0: negative class
1: positive class
‱Some examples of classification are mentioned below:
Email: spam / not spam
Online transactions: fraudulent / not fraudulent
Tumor: malignant / not malignant
Logistic Regression
Hypothesis
How does Logistic
Regression work?
➱ Logistic Regression uses a more complex cost function than Linear
Regression, this cost function is called the ‘Sigmoid function’ or also
known as the ‘logistic function’ instead of a linear function.
➱ The hypothesis of logistic regression tends to limit the cost function
between 0 and 1. Therefore linear functions fail to represent it as it can
have a value greater than 1 or less than 0 which is not possible as per
the hypothesis of logistic regression.
How does Logistic
Regression work?
Decision Boundary
The prediction function returns a probability score between 0 and 1. If you want to map the
discrete class (true/false, yes/no), you will have to select a threshold value above which you will
be classifying values into class 1 and below the threshold value into class 2.
p≄0.5,class=1 p<0.5,class=0
For example, suppose the threshold value is 0.5 and your prediction function returns 0.7, it will
be classified as positive.
If your predicted value is 0.2, which is less than the threshold value, it will be classified as
negative.
Decision Boundary
Linear vs Logistic
Regression
Linear Regression Logistic Regression
Outcome
In linear regression, the outcome
(dependent variable) is continuous. It can
have any one of an infinite number of
possible values.
In logistic regression, the outcome
(dependent variable) has only a limited
number of possible values.
The dependent variable
Linear regression is used when your response
variable is continuous. For instance, weight,
height, number of hours, etc.
Logistic regression is used when the response
variable is categorical in nature. For instance,
yes/no, true/false, red/green/blue, 1st/2nd/3rd/4th,
etc.
Linear vs Logistic
Regression
The independent
variable
In Linear Regression, the
independent variables can be
correlated with each other.
In logistic Regression, the
independent variables should
not be correlated with each
other. (no multi-collinearity)
Equation
Linear regression gives an
equation which is of the form Y
= mX + C, means equation with
degree 1.
Logistic regression gives an
equation which is of the form Y
= eX + e-X.
Linear vs Logistic
Regression
ficient interpretation
In linear regression, the coefficient interpretation
of independent variables are quite
straightforward (i.e. holding all other variables
constant, with a unit increase in this variable,
the dependent variable is expected to
increase/decrease by xxx).
In logistic regression, depends on the
family (binomial, Poisson, etc.) and link
(log, logit, inverse-log, etc.) you use, the
interpretation is different.
Error minimization
technique
Linear regression uses ordinary least squares
method to minimise the errors and arrive at a
best possible fit, while logistic regression uses
maximum likelihood method to arrive at the
solution.
Logistic regression is just the opposite.
Using the logistic loss function causes
large errors to be penalized to an
asymptotic constant.
Linear vs Logistic
Regression

Weitere Àhnliche Inhalte

Ähnlich wie Machine Learning.pdf

HRUG - Linear regression with R
HRUG - Linear regression with RHRUG - Linear regression with R
HRUG - Linear regression with Regoodwintx
 
Regularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptxRegularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptxMohamed Essam
 
Machine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperMachine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperJames by CrowdProcess
 
Machine Learning Interview Question and Answer
Machine Learning Interview Question and AnswerMachine Learning Interview Question and Answer
Machine Learning Interview Question and AnswerLearnbay Datascience
 
AWS Certified Machine Learning Specialty
AWS Certified Machine Learning Specialty AWS Certified Machine Learning Specialty
AWS Certified Machine Learning Specialty Adnan Rashid
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial IndustrySubrat Panda, PhD
 
MachineLlearning introduction
MachineLlearning introductionMachineLlearning introduction
MachineLlearning introductionThe IOT Academy
 
Introduction to ml
Introduction to mlIntroduction to ml
Introduction to mlSuyashSingh70
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2uetian12
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesVimal Gupta
 
General Concepts of Machine Learning
General Concepts of Machine LearningGeneral Concepts of Machine Learning
General Concepts of Machine LearningKush Kulshrestha
 
Machine Learning Algorithm for Business Strategy.pdf
Machine Learning Algorithm for Business Strategy.pdfMachine Learning Algorithm for Business Strategy.pdf
Machine Learning Algorithm for Business Strategy.pdfPhD Assistance
 
Supervised Learning.pdf
Supervised Learning.pdfSupervised Learning.pdf
Supervised Learning.pdfgadissaassefa
 
How to understand and implement regression analysis
How to understand and implement regression analysisHow to understand and implement regression analysis
How to understand and implement regression analysisClaireWhittaker5
 
Introduction-to-Non-Linear-Regression.pptx
Introduction-to-Non-Linear-Regression.pptxIntroduction-to-Non-Linear-Regression.pptx
Introduction-to-Non-Linear-Regression.pptxShriramKargaonkar
 
Explore ML day 1
Explore ML day 1Explore ML day 1
Explore ML day 1preetikumara
 
Regression analysis made easy
Regression analysis made easyRegression analysis made easy
Regression analysis made easyWeam Banjar
 
Module 4: Model Selection and Evaluation
Module 4: Model Selection and EvaluationModule 4: Model Selection and Evaluation
Module 4: Model Selection and EvaluationSara Hooker
 
Supervised learning techniques and applications
Supervised learning techniques and applicationsSupervised learning techniques and applications
Supervised learning techniques and applicationsBenjaminlapid1
 

Ähnlich wie Machine Learning.pdf (20)

HRUG - Linear regression with R
HRUG - Linear regression with RHRUG - Linear regression with R
HRUG - Linear regression with R
 
Regularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptxRegularization_BY_MOHAMED_ESSAM.pptx
Regularization_BY_MOHAMED_ESSAM.pptx
 
Machine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paperMachine learning in credit risk modeling : a James white paper
Machine learning in credit risk modeling : a James white paper
 
Machine Learning Interview Question and Answer
Machine Learning Interview Question and AnswerMachine Learning Interview Question and Answer
Machine Learning Interview Question and Answer
 
AWS Certified Machine Learning Specialty
AWS Certified Machine Learning Specialty AWS Certified Machine Learning Specialty
AWS Certified Machine Learning Specialty
 
Machine Learning in the Financial Industry
Machine Learning in the Financial IndustryMachine Learning in the Financial Industry
Machine Learning in the Financial Industry
 
MachineLlearning introduction
MachineLlearning introductionMachineLlearning introduction
MachineLlearning introduction
 
Introduction to ml
Introduction to mlIntroduction to ml
Introduction to ml
 
2018 p 2019-ee-a2
2018 p 2019-ee-a22018 p 2019-ee-a2
2018 p 2019-ee-a2
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbies
 
General Concepts of Machine Learning
General Concepts of Machine LearningGeneral Concepts of Machine Learning
General Concepts of Machine Learning
 
Machine Learning Algorithm for Business Strategy.pdf
Machine Learning Algorithm for Business Strategy.pdfMachine Learning Algorithm for Business Strategy.pdf
Machine Learning Algorithm for Business Strategy.pdf
 
Supervised Learning.pdf
Supervised Learning.pdfSupervised Learning.pdf
Supervised Learning.pdf
 
How to understand and implement regression analysis
How to understand and implement regression analysisHow to understand and implement regression analysis
How to understand and implement regression analysis
 
Introduction-to-Non-Linear-Regression.pptx
Introduction-to-Non-Linear-Regression.pptxIntroduction-to-Non-Linear-Regression.pptx
Introduction-to-Non-Linear-Regression.pptx
 
Explore ML day 1
Explore ML day 1Explore ML day 1
Explore ML day 1
 
Regression analysis made easy
Regression analysis made easyRegression analysis made easy
Regression analysis made easy
 
AI.pdf
AI.pdfAI.pdf
AI.pdf
 
Module 4: Model Selection and Evaluation
Module 4: Model Selection and EvaluationModule 4: Model Selection and Evaluation
Module 4: Model Selection and Evaluation
 
Supervised learning techniques and applications
Supervised learning techniques and applicationsSupervised learning techniques and applications
Supervised learning techniques and applications
 

KĂŒrzlich hochgeladen

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

KĂŒrzlich hochgeladen (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Machine Learning.pdf

  • 1. Machine Learning Engr.Muhammad Suleman Memon Assistant Professor & HoD Department of Information Technology Email: engrsuleman14@gmail.com Cell#: 923332941065
  • 2. What is Machine Learning Machine learning is a segment of artificial intelligence. It is designed to make computers learn by themselves and perform operations without human intervention. It means a computer or a system designed with machine learning will identify, analyse and change accordingly and give the expected output when it comes across a new pattern of data, without any need of humans.
  • 5. Machine Learning – Methods SUPERVISED LEARNING UNSUPERVISED LEARNING SEMI-SUPERVISED LEARNING REINFORCEMENT LEARNING
  • 6.
  • 7. Machine Learning – Algorithms Neural networks Decision trees Random forests Support vector machines Nearest- neighbor mapping k-means clustering Self-organizing maps Expectation maximization Bayesian networks Kernel density estimation Principal component analysis Singular value decomposition
  • 9. Which Industries Use Machine Learning? â–Ș Pharmaceuticals â–Ș Banks and Financial Services â–Ș Health Care and Treatments â–Ș Online Sales â–Ș Mining, Oil and Gas â–Ș Government Schemes
  • 10. Linear Regression in Machine Learning Linear Regression is an algorithm that belongs to supervised Machine Learning. It tries to apply relations that will predict the outcome of an event based on the independent variable data points. The relation is usually a straight line that best fits the different data points as close as possible. The output is of a continuous form, i.e., numerical value. For example, the output could be revenue or sales in currency, the number of products sold, etc.
  • 11. Linear Regression Equation Linear regression can be expressed mathematically as: y= ÎČ0+ ÎČ 1x+ Δ Y= Dependent Variable X= Independent Variable ÎČ 0= intercept of the line ÎČ1 = Linear regression coefficient (slope of the line) Δ = random error
  • 12. Types of Linear Regression Simple Linear Regression Multiple Linear Regression Non-Linear Regression
  • 13. Simple Linear Regression A simple straight-line equation involving slope (dy/dx) and intercept (an integer/continuous value) is utilized in simple Linear Regression. y=mx+c where y denotes the output, x is the independent variable, and c is the intercept when x=0.
  • 14. Multiple Linear Regression â–Ș When a number of independent variables are more than one, the governing linear equation applicable to regression takes a different form like: â–Ș y= c+m1x1+m2x2
 mnxn where represents the coefficient responsible for impact of different independent variables x1, x2 etc.
  • 15. Non-Linear Regression â–Ș When the best fitting line is not a straight line but a curve, it is referred to as Non-Linear Regression.
  • 16. Advantages of Linear Regression For linear datasets, Linear Regression performs well to find the nature of the relationship among different variables. Linear Regression algorithms are easy to train and the Linear Regression models are easy to implement. Although, the Linear Regression models are likely to over-fit, but can be avoided using dimensionality reduction techniques such as regularization (L1 and L2) and cross- validation.
  • 17. Disadvantages of Linear Regression An important disadvantage of Linear Regression is that it assumes linearity between the dependent and independent variables, which is rarely represented in real-world data. It assumes a straight-line relationship between the dependent and independent variables, which is unlikely many times. It is prone to noise and overfitting. In datasets where the number of observations is lesser than the attributes, Linear Regression might not be a good choice as it can lead to overfitting. This is because the algorithm can start considering the noise while building the model.
  • 18. Key Benefits of Linear Regression Easy to Implement Scalability Interpretability Applicability in real-time
  • 19. Use Cases of Linear Regression ➱ Agriculture ➱ Banking ➱ Finance ➱ Education ➱ Marketing
  • 20. Agriculture â–Ș Can be used to predict the amount of rainfall and crop yield.
  • 21. Banking â–Ș it is implemented to predict probability of loan defaults.
  • 22. Finance sector â–Ș used to predict stock prices and assess associated risks.
  • 23. Healthcare Sector â–Ș Helpful in modelling the healthcare costs, predicting the length of stay in hospitals for patients.
  • 24. Sports analytics â–Ș Can be used to predict the performance of players in upcoming games. Similarly
  • 25. Education â–Ș Can be used in education to predict student performances in different courses.
  • 26. Business â–Ș To forecast product demands, predict product sales, decide on marketing and advertising strategies, and so on.
  • 27. Best Practices for Linear Regression 1. Follow the Assumptions 2. Start with a Simple Model First 3. Use Visualizations 4. Start with Sample Dataset 5. Shifting to Multi-Linear Regression 6. Applying Linear Regression Model to Real-life Problems 7. Choosing Appropriate Data
  • 28. Frequently Asked Questions (FAQs) 1. What is the output of Linear Regression in machine learning? 2. What are the benefits of using Linear Regression? 3. How do you explain a Linear Regression model? 4. Which type of dataset is used for Linear Regression? 5. Which ML model is best for regression?
  • 29. Logistic Regression Logistic Regression is a popular statistical model used for binary classification, that is for predictions of the type this or that, yes or no, A or B, etc. Logistic regression can, however, be used for multiclass classification. 0: negative class 1: positive class ‱Some examples of classification are mentioned below: Email: spam / not spam Online transactions: fraudulent / not fraudulent Tumor: malignant / not malignant
  • 31. How does Logistic Regression work? ➱ Logistic Regression uses a more complex cost function than Linear Regression, this cost function is called the ‘Sigmoid function’ or also known as the ‘logistic function’ instead of a linear function. ➱ The hypothesis of logistic regression tends to limit the cost function between 0 and 1. Therefore linear functions fail to represent it as it can have a value greater than 1 or less than 0 which is not possible as per the hypothesis of logistic regression.
  • 33. Decision Boundary The prediction function returns a probability score between 0 and 1. If you want to map the discrete class (true/false, yes/no), you will have to select a threshold value above which you will be classifying values into class 1 and below the threshold value into class 2. p≄0.5,class=1 p<0.5,class=0 For example, suppose the threshold value is 0.5 and your prediction function returns 0.7, it will be classified as positive. If your predicted value is 0.2, which is less than the threshold value, it will be classified as negative.
  • 35. Linear vs Logistic Regression Linear Regression Logistic Regression Outcome In linear regression, the outcome (dependent variable) is continuous. It can have any one of an infinite number of possible values. In logistic regression, the outcome (dependent variable) has only a limited number of possible values. The dependent variable Linear regression is used when your response variable is continuous. For instance, weight, height, number of hours, etc. Logistic regression is used when the response variable is categorical in nature. For instance, yes/no, true/false, red/green/blue, 1st/2nd/3rd/4th, etc.
  • 36. Linear vs Logistic Regression The independent variable In Linear Regression, the independent variables can be correlated with each other. In logistic Regression, the independent variables should not be correlated with each other. (no multi-collinearity) Equation Linear regression gives an equation which is of the form Y = mX + C, means equation with degree 1. Logistic regression gives an equation which is of the form Y = eX + e-X.
  • 37. Linear vs Logistic Regression ficient interpretation In linear regression, the coefficient interpretation of independent variables are quite straightforward (i.e. holding all other variables constant, with a unit increase in this variable, the dependent variable is expected to increase/decrease by xxx). In logistic regression, depends on the family (binomial, Poisson, etc.) and link (log, logit, inverse-log, etc.) you use, the interpretation is different. Error minimization technique Linear regression uses ordinary least squares method to minimise the errors and arrive at a best possible fit, while logistic regression uses maximum likelihood method to arrive at the solution. Logistic regression is just the opposite. Using the logistic loss function causes large errors to be penalized to an asymptotic constant.