The document provides an overview of machine learning, detailing its definition, processes, and various algorithms including linear regression, logistic regression, decision trees, random forests, and k-nearest neighbors. It explains real-world applications of machine learning in fields like healthcare, finance, and marketing. Additionally, the document illustrates implementation steps for several algorithms, including data preprocessing, model training, and evaluation metrics.
Explores how Snapchat's filter works using machine learning based on color patterns in images. Discusses various types of algorithms and their applications.
Highlights real-world applications including face recognition, healthcare, and Siri/Cortana, illustrating the impact of machine learning.
Defines machine learning as a method for computers to learn from data without explicit programming, detailing the processes of training and prediction.
Outlines the steps involved in machine learning: data gathering, preprocessing, model selection, training, testing, tuning, and prediction.
Details various types of algorithms: supervised, unsupervised, and reinforcement learning, along with real-world applications in classification and regression.
List of popular algorithms including Linear Regression, Logistic Regression, Decision Trees, Random Forest, and K Nearest Neighbors.
Introduces linear regression, explaining the concept of best fit lines and how to predict values using independent variables.
Step-by-step process of implementing linear regression to predict employee salaries based on experience, including data import and visualization.Explains logistic regression as a classification algorithm for predicting binary outcomes, using credit card default as an example.
Step-by-step guide for implementing logistic regression to predict SUV purchases, including confusion matrix evaluation and accuracy metrics.
Introduces decision trees as a classification tool with examples, explaining the structure from root nodes to leaf nodes.
Evaluates decision tree models using confusion matrices and compares accuracy with Random Forest implementations.
Introduces KNN as a classification algorithm highlighting the role of 'K' in classifying new data points.
Step-by-step implementation of KNN to predict SUV purchases, with a focus on model evaluation through confusion matrix.
Concluding remarks of the presentation, summarizing the key points discussed regarding machine learning and its applications.
Machine Learning Example
Matrixof numbers
Looks for color patterns
on face
Points align
themselves and
look for areas of
contrast
7.
Machine Learning Example
Matrixof numbers
Looks for color patterns
on face
Points align
themselves and
look for areas of
contrast
8.
What’s in itfor you?
Types of Machine Learning Algorithms
Real World Applications of Machine Learning
Processes involved in Machine Learning
What is Machine Learning?
Logistic Regression
Linear Regression
Decision Tree and Random forest
K Nearest Neighbors
Popular Algorithms with Hands On Demo
Real World Applicationsof Machine Learning
Face Recognition Healthcare Industry Weather Forecasting
Produce a Web Series Prepare a new Drink
Siri and Cortana
What is MachineLearning?
Machine Learning is the science of making computers learn and act like humans by feeding
data and information without being explicitly programmed.
13.
What is MachineLearning?
Past Data
Machine Learning is the science of making computers learn and act like humans by feeding
data and information without being explicitly programmed.
14.
What is MachineLearning?
Past Data
Analyses
Machine Learning is the science of making computers learn and act like humans by feeding
data and information without being explicitly programmed.
15.
What is MachineLearning?
Past Data
Analyses
Trains
Machine Learning is the science of making computers learn and act like humans by feeding
data and information without being explicitly programmed.
16.
What is MachineLearning?
Past Data
Analyses
Predicts
Trains
Machine Learning is the science of making computers learn and act like humans by feeding
data and information without being explicitly programmed.
Output
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
19.
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
Choose
Model
20.
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
Choose
Model
Train Model
21.
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
Choose
Model
Train Model
Test Model
22.
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
Choose
Model
Train Model
Test Model
Tune Model
23.
Processes involved inMachine Learning
Data
Gathering
7Machine Learning
Processes
Data
Pre-Processing
Choose
Model
Train Model
Test Model
Tune Model
Prediction
24.
Types of MachineLearning Algorithms
VSupervised
Learning
Un-Supervised
Learning
Reinforcement
Learning
Machine
Learning
Association
• Market Basket Analysis
• Text Mining
• Face Recognition
Classification
• Fraud Detection
• Email Spam Detection
• Image Classification
Regression
• Weather Forecasting
• Risk Assessment
• Score Prediction
Clustering
• Medical Research
• City Planning
• Targeted Marketing
Reinforcement Learning
• Gaming
• Robot Navigation
• Stock Trading
• Assembly Line Processes
Popular Algorithms inMachine Learning
Algorithm 1
Algorithm 2
Linear
Regression
Logistic
Regression
27.
Popular Algorithms inMachine Learning
Algorithm 1
Decision
Tree
Algorithm 2
Algorithm 3
Linear
Regression
Logistic
Regression
28.
Popular Algorithms inMachine Learning
Algorithm 1
Decision
Tree
Random
Forest
Algorithm 2
Algorithm 3
Algorithm 4
Linear
Regression
Logistic
Regression
29.
Popular Algorithms inMachine Learning
Algorithm 1
Decision
Tree
Random
Forest
K Nearest
Neighbors
Algorithm 2
Algorithm 3
Algorithm 4
Algorithm 5
Linear
Regression
Logistic
Regression
History of LinearRegression
Linear Regression: Brief history on how Regression came into picture.
Francis Galton Heights of Father and Son
Studied
Best fit
line
Regression Line
Analyzed
Height Data
Mean Height of all People
Regressed
32.
Linear Regression
Linear Regressionis a linear modelling approach to find relationship between one or more independent variables (predictors)
denoted as X and dependent variable (target) denoted as Y.
Temperature
Sales
Temperature
Sales
Regression line to predict the sales
Plotting the sales of ice cream based
on temperature
Predict sales of Ice Cream based on temperature:
33.
Linear Regression
Finding thebest fit line: The best fit line can be found out by minimizing the distance between all the data points and the distance
to the regression line. Ways to minimize this distance are sum of squared errors, sum of absolute errors etc.
Distance between the data points
and the line is maximum
Not the best fit line
34.
Finding the bestfit line: The best fit line can be found out by minimizing the distance between all the data points and the distance
to the regression line. Ways to minimize this distance are sum of squared errors, sum of absolute errors etc.
Linear Regression
Not the best fit line
Distance between the data points
and the line can still be reduced
35.
Linear Regression
Finding thebest fit line: The best fit line can be found out by minimizing the distance between all the data points and the distance
to the regression line. Ways to minimize this distance are sum of squared errors, sum of absolute errors etc.
Distance between the data points
and the line is the least
Best fit regression line
36.
Implementation of LinearRegression
Linear Regression: Predict Employee Salary based on Years of Experience.
HR team trying to figure out how much
to pay to a new joinee?
Predict Salary
How much do we pay her?
New Joinee
Years of experience
Salary
Employee data of Salary
based on Years of experience
Logistic Regression
Logistic Regressionis a Classification algorithm used to predict discrete/ categorical values
Who will default on their credit card payment?
46.
Logistic Regression
Logistic Regressionis a Classification algorithm used to predict discrete/ categorical values
Who will default on their credit card payment?
Credit card users
47.
Logistic Regression
Logistic Regressionis a Classification algorithm used to predict discrete/ categorical values
Who will default on their credit card payment?
Credit card users Make credit card
transaction
48.
Logistic Regression
Logistic Regressionis a Classification algorithm used to predict discrete/ categorical values
Who will default on their credit card payment?
Credit card users
Plot of monthly credit card balance
and annual income
Make credit card
transaction
49.
Logistic Regression
Plotting theLogistic Regression Curve: The Logistic Regression curve is known as the Sigmoid curve (S curve)
Predicted Y lies in the range 0 and 1
1
1 + e-zP =
Predicted Y can exceed the range 0 and 1
Y = m1x+c0
50.
Logistic Regression
Plotting theLogistic Regression Curve: The Logistic Regression curve is known as the Sigmoid curve (S curve)
Y = m1x+c0
0.5
Threshold
value
0.5
Cutoff point at 0.5, anything below it
results in 0 and above is 1
Red data point will default as it is above
the threshold value of 0.5 and green data
point won’t as it is below the threshold
value
51.
Implementation of LogisticRegression
Logistic Regression: Predict if a person will buy an SUV based on their Age and Estimated Salary
Age Estimated
Salary
52.
Implementation of LogisticRegression
1. Load the libraries:
2. Import the dataset and extract the independent and dependent variables:
Implementation of LogisticRegression
4. Split the dataset into Training and Testing set:
5. Feature Scaling:
6. Fit Logistic Regression to Training dataset:
Decision Tree
Decision Treeis a tree where each node represents a feature (attribute), each link (branch) represents a decision and each leaf
represents an outcome (categorical or continuous value).
Should the person accept a new job offer?
Yes
Salary >
$60,000
Root Node
Accept a job offer?
Reject
Offer
No
Leaf node
Accept
offer
Yes
Reject
Offer
No
Reject
Offer
YesNo
Performance
Incentives
Decision
node
Commute > 1
hour
61.
Implementation of DecisionTree
Decision Tree and Random Forest: Does Kyphosis exist after a surgery?
Bunch of kids Kyphosis surgery Predict kyphosis
present or absent?
62.
Implementation of DecisionTree
Classification Tree for Kyphosis:
Start>=8.5
Absent 64/17
Present
8/11
No
Start>=14.5
Absent 56/6
Yes
Absent
12/0
Yes
Absent
29/0
Yes
Absent
12/2
Yes
Age<55
Absent 27/6
No
Age>=111
Absent 15/6
No
Present
3/4
No
63.
Implementation of DecisionTree
1. Load the libraries:
2. Import the dataset and extract the independent and dependent variables:
K Nearest Neighbors(KNN)
K Nearest Neighbors: KNN is a Classification algorithm generally used to predict categorical values.
Height(ft)
Weight (lbs)
Class Dog
1.5
3.5
2.0
3.0
2.5
1.0
0.5
0 65 75 9585 105
Class Cat
Weight (lbs)
Class Dog
1.5
3.5
2.0
3.0
2.5
1.0
0.5
0 65 75 9585 105
Height(ft)
New data
point
Class Cat
To find if a new data point is a or a ?
71.
Choosing a Kwill define what class a new data point is assigned to:
K Nearest Neighbors
Height(ft)
Class Dog
Weight (lbs)
0.5
2.5
2.0
1.5
3.0
1.0
3.5
10565 75 85 95
Class Cat
K=3
If K=3, the new data point
belongs to class Cat
K=7
If K=7, the new data point
belongs to class Dog
Implementation of KNN
10.Evaluate the model by creating a confusion matrix:
Understanding the confusion matrix:
N = 100 Predicted: No Predicted: Yes
Actual: No TN=64 FP=4
Actual: Yes FN=3 TP=29
Accuracy:
(TN+TP)/N
(64+29)/100 = 0.93
Misclassification Rate:
(FP+FN)/N
(4+3)/100 = 0.07