SlideShare a Scribd company logo
Lesson 4
Supervised Learning
2
Legal Disclaimers
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by
this document.
Intel technologies’ features and benefits depend on system configuration and may require enabled
hardware, software or service activation. Performance varies depending on system configuration. Check
with your system manufacturer or retailer or learn more at intel.com.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of
merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising
from course of performance, course of dealing, or usage in trade.
Copies of documents which have an order number and are referenced in this document may be obtained
by calling 1-800-548-4725 or by visiting www.intel.com/design/literature.htm.
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others
Copyright © 2018 Intel Corporation. All rights reserved.
3
Learning Objectives
• Name the steps in the data science workflow
• Explain how to formulate a supervised learning problem
• Compare “Training” and “Inference”
• Describe the dangers of overfitting, and training vs. testing data
• Identify the advantages of the PyData* ecosystem
You will be able to:
*Other names and brands may be claimed as the property of others.
Supervised learning
5
Machine Learning
The study and construction of programs that learn from repeatedly seeing data,
rather than being explicitly programmed by humans.
Data points have
known outcome
Supervised
Learning
Unsupervised
Learning
Dataset
Data points have
unknown outcome
Type
6
Target vs. Features
TargetFeatures
Target: Column to predict
Features: Properties of the data used for prediction (non-target columns)
Example: Supervised Learning Problem
NOT SPAM?
Supervised
Learning
Program
SPAM?
Goal: Predict if an email is spam or not spam.
Data: Historical emails labeled as spam or not spam.
Target: Spam or not spam
Features: Email text, subject, time sent, etc.
Example: Supervised Learning Problem
Goal: Predict location of bounding box
around an object.
Data: Images with bounding box locations.
Target: Corners of bounding box
Features: Image pixels
Supervised learning
10
Data Science Workflow
Problem Statement
Data Collection
Data Exploration
& Preprocessing
Modeling
Validation
Decision Making
& Deployment
What problem are you trying to solve?
What data do you need to solve it?
How should you clean your data so your model can use it?
Build a model to solve your problem?
Did I solve the problem?
Communicate to stakeholders or put into production?
11
This Lesson’s Focus: Modeling and Validation
Problem Statement
Data Collection
Data Exploration
& Preprocessing
Modeling
Validation
Decision Making
& Deployment
What problem are you trying to solve?
What data do you need to solve it?
How should you clean your data so your model can use it?
Build a model to solve your problem?
Did I solve the problem?
Communicate to stakeholders or put into production?
Supervised learning
Formulating a Supervised Learning Problem
13
For a Supervised Learning Problem:
• Collect a labeled dataset (features and target labels).
• Choose the model.
• Choose an evaluation metric:
“What to use to measure performance.”
• Choose an optimization method:1
“How to find the model configuration that gives the best performance.”
1There are standard methods to use for different models and metrics.
Decision tree
Which Model?
14
There are many models that represent the problem and make decisions in
different ways each with their own advantages and disadvantages.
A decision tree makes predictions by asking a series of yes/no questions.
Nearest neighbor makes predictions by having the most similar examples vote.
Nearest neighbors
Which Model?
15
Some considerations when choosing are:
• Time needed for training
• Speed in making predictions
• Amount of data needed
• Type of data
• Problem complexity
• Ability to solve a complex problem
• Tendency to overcomplicate a simple one
Accuracy target
Evaluation Metric
16
There are many metrics available1 to measure performance,
such as:
• Accuracy: how well predictions match true values.
• Mean Squared Error: average square distance
between prediction and true value.
1The wrong metric can be misleading or not capture the real problem.
Mean square error formula
Evaluation Metric
17
Email
The wrong metric can be misleading or not capture the real problem.
For example: consider using accuracy for spam/not spam.
• If 99 out of 100 emails are actually spam, then a model that is predicting
spam every time will have 99% accuracy.
• This may force an important real email into spam,
even though it has a high accuracy metric.
Training
18
Training Data: The dataset used to train the model.
Optimization: Configures the model for best performance.
?
Error
Training
19
Forward
Backward
“Bicycle!” “Strawberry?”
Human
Bicycle
Strawberry
With these pieces, a model can now be trained to find the best configuration.
Labeled Data Model Evaluation Metric
Inference
20
Once the model is trained, we can provide new examples for predictions.
??????
“Bicycle!”
ModelNew Data Prediction
Training vs. Inference
21
Goal: Perform well on unseen data during inference.
??????
“Bicycle!”
?
Error
“Bicycle!” “Strawberry?”
Human
Bicycle
Strawberry
Model
weights
TrainingInference
Supervised Learning Overview
22
Data with answers
(features and labels)
Model+ Trained
Model
Fit
Data without answers
(features only)
Trained
Model
+ Predicted
Answer
Predict
Training: Train a model with known data.
Inference: Feed unseen data into trained model to make predictions.
Supervised learning
Curve Fitting: Overfitting vs. Underfitting Example
24
X
Y
Goal: Fit a curve to the data.
X
Y
Curve Fitting: Underfitting Example
25
The curve can be too simple.
• This is called “underfitting”
• Poor fit on training data
• Poor fit on unseen data
Underfitting: Model is missing systematic
trends in data.
X
Y
Curve Fitting: Overfitting Example
26
The curve can be too complex.
• This is called “overfitting”
• Good fit on training data
• Poor fit on unseen data
Overfitting: Model is too sensitive
and fits the “noise” in the training data.
Curve Fitting Problem
27
Problem: Unseen data isn’t available during training.
• How can performance be estimated?
When measuring performance on the training data, there is a tendency to overfit.
Underfit Well fit Overfit
28
Solution: Split Data Into Two Sets
Training Set
Testing Set
Training Set: Data used during the training process.
Test Set: Data used to measure performance, simulating unseen data1.
1 Not used during the training process.
*Other names and brands may be claimed as the property of others.
29
Train-Test Split
Model Weights
Training Data
Testing Data
Evaluate trained model on data it hasn’t “seen” before
to simulate real-world inference.
“Trained Model”
Training
Inference
Prediction
*Other names and brands may be claimed as the property of others.
31
Why Python*?
• General purpose language.
• Simple, readable syntax relative to other languages, such as Java* or C++.
• Has a good REPL.
• Can facilitate applications written in other languages, C++ and Fortran.
• Active community.
• Extensive libraries.
*Other names and brands may be claimed as the property of others.
32
Python*: Fastest Growing Programming Language1
1Source:
Stack Overflow
*Other names and brands may be claimed as the property of others.
33
Python*: Highest Ranked Language1
1Source:
IEEE Spectrum
*Other names and brands may be claimed as the property of others.
34
Python* Libraries for Data Science
Fast numerical computing Data analysis and manipulation
Machine learning Visualization
Deep Learning
*Other names and brands may be claimed as the property of others.
Intel® Distribution for Python*
Easy, Out-of-the-box Access to High Performance Python*
• Prebuilt, optimized for numerical computing, data analytics, High
Performance Computing (HPC).
• Drop in replacement for your existing Python (no code changes required).
• Download from https://software.intel.com/en-us/distribution-for-python
*Other names and brands may be claimed as the property of others.
Intel® Distribution for Python*
Drive Performance with Multiple Optimization Techniques
• Accelerated NumPy/ SciPy / Scikit-Learn with the Intel® Math Kernel
Library (Intel® MKL).
• Data analytics with pyDAAL, enhanced thread scheduling with Intel®
Thread Building Blocks (Intel® TBB), Jupyter* Notebook interface,
Numba, Cython*.
• Scale easily with optimized MPI4Py* and Jupyter* notebooks.
*Other names and brands may be claimed as the property of others.
Intel® Distribution for Python*
Faster Access to Latest Optimizations for Intel® Architecture
• Distribution and individual optimized packages available
through Conda* and Anaconda Cloud*.
• Optimizations upstreamed back to main Python* trunk.
*Other names and brands may be claimed as the property of others.
Train and Test Splitting: Syntax
Import the train and test split function.
from sklearn.model_selection import train_test_split
Split the data and put 30% into the test set.
train, test = train_test_split(data, test_size=0.3)
Other method for splitting data.
from sklearn.model_selection import ShuffleSplit
Import the class containing the classification method.
from sklearn.neighbors import KNeighborsClassifier
Create an instance of the class.
KNN = KNeighborsClassifier(n_neighbors=3)
Fit the instance on the data and then predict the expected value.
KNN = KNN.fit(X_data, y_data)
y_predict = KNN.predict(X_data)
K Nearest Neighbors: The Syntax
40
Learning Objectives Recap
• Name the steps in the data science workflow
• Explain how to formulate a supervised learning problem
• Compare “Training” and “Inference”
• Describe the dangers of overfitting, and training vs. testing data
• Identify the advantages of the PyData* ecosystem
In this lesson, we worked to:
*Other names and brands may be claimed as the property of others.
Supervised learning

More Related Content

PPTX
Supervised Machine Learning
PPTX
Machine Learning Contents.pptx
PDF
Supervised learning
PDF
Supervised Machine Learning With Types And Techniques
PPTX
Supervised Machine Learning Techniques
PPTX
Unsupervised Machine Learning
PDF
"An Introduction to Machine Learning and How to Teach Machines to See," a Pre...
PPTX
Machine Learning PPT BY RAVINDRA SINGH KUSHWAHA B.TECH(IT) CHAUDHARY CHARAN S...
Supervised Machine Learning
Machine Learning Contents.pptx
Supervised learning
Supervised Machine Learning With Types And Techniques
Supervised Machine Learning Techniques
Unsupervised Machine Learning
"An Introduction to Machine Learning and How to Teach Machines to See," a Pre...
Machine Learning PPT BY RAVINDRA SINGH KUSHWAHA B.TECH(IT) CHAUDHARY CHARAN S...

What's hot (20)

PDF
Differences Between Machine Learning Ml Artificial Intelligence Ai And Deep L...
PPTX
Machine Learning
PPT
Machine learning
PDF
Machine learning
PPTX
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
PDF
Machine Learning: Applications, Process and Techniques
PDF
AutoML - The Future of AI
PDF
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
PDF
Introduction to Machine Learning
PDF
Machine Learning
PPTX
Machine learning
PPTX
Machine learning
PPT
Machine learning
PPTX
Machine learning ppt
PPT
2.17Mb ppt
PPTX
Machine Learning ppt
PDF
The fundamentals of Machine Learning
PPTX
Logistic Regression | Logistic Regression In Python | Machine Learning Algori...
PPTX
Types of Machine Learning
PPTX
Supervised Unsupervised and Reinforcement Learning
Differences Between Machine Learning Ml Artificial Intelligence Ai And Deep L...
Machine Learning
Machine learning
Machine learning
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
Machine Learning: Applications, Process and Techniques
AutoML - The Future of AI
Machine Learning in 10 Minutes | What is Machine Learning? | Edureka
Introduction to Machine Learning
Machine Learning
Machine learning
Machine learning
Machine learning
Machine learning ppt
2.17Mb ppt
Machine Learning ppt
The fundamentals of Machine Learning
Logistic Regression | Logistic Regression In Python | Machine Learning Algori...
Types of Machine Learning
Supervised Unsupervised and Reinforcement Learning
Ad

Similar to Supervised learning (20)

PPTX
Machine-Learning-Overview a statistical approach
PPTX
Machine Learning vs Decision Optimization comparison
PDF
ML Basics
PPTX
Model Development And Evaluation in ML.pptx
PPTX
machine learning types methods classification regression decision tree
PDF
Choosing a Machine Learning technique to solve your need
PPTX
04-Machine-Learning-Overview pros and cons
PPTX
Machine Learning AND Deep Learning for OpenPOWER
PPTX
Week_1 Machine Learning introduction.pptx
PPTX
Building High Available and Scalable Machine Learning Applications
PPT
Unit-1.ppt
PDF
Machine learning Introduction
PDF
Making Machine Learning Work in Practice - StampedeCon 2014
PPTX
Machine Learning Essentials Demystified part1 | Big Data Demystified
PDF
Machine Learning with Big Data using Apache Spark
PPTX
Intro to ML for product school meetup
PPTX
Machine learning introduction
PPTX
supervised learning
PDF
amarsppt-151204090549-lva1-app6891.pdf
PPTX
Essential of ML 1st Lecture IIT Kharagpur
Machine-Learning-Overview a statistical approach
Machine Learning vs Decision Optimization comparison
ML Basics
Model Development And Evaluation in ML.pptx
machine learning types methods classification regression decision tree
Choosing a Machine Learning technique to solve your need
04-Machine-Learning-Overview pros and cons
Machine Learning AND Deep Learning for OpenPOWER
Week_1 Machine Learning introduction.pptx
Building High Available and Scalable Machine Learning Applications
Unit-1.ppt
Machine learning Introduction
Making Machine Learning Work in Practice - StampedeCon 2014
Machine Learning Essentials Demystified part1 | Big Data Demystified
Machine Learning with Big Data using Apache Spark
Intro to ML for product school meetup
Machine learning introduction
supervised learning
amarsppt-151204090549-lva1-app6891.pdf
Essential of ML 1st Lecture IIT Kharagpur
Ad

More from ankit_ppt (20)

PPTX
Deep learning summary
PPTX
08 neural networks
PPTX
07 learning
PPTX
06 image features
PPTX
05 contours seg_matching
PPTX
04 image transformations_ii
PPTX
03 image transformations_i
PPTX
02 image processing
PPTX
01 foundations
PPTX
Word2 vec
PPTX
Text similarity measures
PPTX
Text generation and_advanced_topics
PPTX
Nlp toolkits and_preprocessing_techniques
PPTX
Matrix decomposition and_applications_to_nlp
PPTX
Machine learning and_nlp
PPTX
Latent dirichlet allocation_and_topic_modeling
PPTX
Intro to nlp
PPTX
Ot regularization and_gradient_descent
PPTX
Ml10 dimensionality reduction-and_advanced_topics
PPTX
Ml9 introduction to-unsupervised_learning_and_clustering_methods
Deep learning summary
08 neural networks
07 learning
06 image features
05 contours seg_matching
04 image transformations_ii
03 image transformations_i
02 image processing
01 foundations
Word2 vec
Text similarity measures
Text generation and_advanced_topics
Nlp toolkits and_preprocessing_techniques
Matrix decomposition and_applications_to_nlp
Machine learning and_nlp
Latent dirichlet allocation_and_topic_modeling
Intro to nlp
Ot regularization and_gradient_descent
Ml10 dimensionality reduction-and_advanced_topics
Ml9 introduction to-unsupervised_learning_and_clustering_methods

Recently uploaded (20)

PDF
Abrasive, erosive and cavitation wear.pdf
PPT
Occupational Health and Safety Management System
PDF
737-MAX_SRG.pdf student reference guides
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Soil Improvement Techniques Note - Rabbi
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PPTX
introduction to high performance computing
PPTX
communication and presentation skills 01
PPTX
UNIT - 3 Total quality Management .pptx
PPT
introduction to datamining and warehousing
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPTX
Artificial Intelligence
Abrasive, erosive and cavitation wear.pdf
Occupational Health and Safety Management System
737-MAX_SRG.pdf student reference guides
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Soil Improvement Techniques Note - Rabbi
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Fundamentals of Mechanical Engineering.pptx
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
introduction to high performance computing
communication and presentation skills 01
UNIT - 3 Total quality Management .pptx
introduction to datamining and warehousing
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Artificial Intelligence

Supervised learning

  • 2. 2 Legal Disclaimers No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document. Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer or learn more at intel.com. Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade. Copies of documents which have an order number and are referenced in this document may be obtained by calling 1-800-548-4725 or by visiting www.intel.com/design/literature.htm. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others Copyright © 2018 Intel Corporation. All rights reserved.
  • 3. 3 Learning Objectives • Name the steps in the data science workflow • Explain how to formulate a supervised learning problem • Compare “Training” and “Inference” • Describe the dangers of overfitting, and training vs. testing data • Identify the advantages of the PyData* ecosystem You will be able to: *Other names and brands may be claimed as the property of others.
  • 5. 5 Machine Learning The study and construction of programs that learn from repeatedly seeing data, rather than being explicitly programmed by humans. Data points have known outcome Supervised Learning Unsupervised Learning Dataset Data points have unknown outcome Type
  • 6. 6 Target vs. Features TargetFeatures Target: Column to predict Features: Properties of the data used for prediction (non-target columns)
  • 7. Example: Supervised Learning Problem NOT SPAM? Supervised Learning Program SPAM? Goal: Predict if an email is spam or not spam. Data: Historical emails labeled as spam or not spam. Target: Spam or not spam Features: Email text, subject, time sent, etc.
  • 8. Example: Supervised Learning Problem Goal: Predict location of bounding box around an object. Data: Images with bounding box locations. Target: Corners of bounding box Features: Image pixels
  • 10. 10 Data Science Workflow Problem Statement Data Collection Data Exploration & Preprocessing Modeling Validation Decision Making & Deployment What problem are you trying to solve? What data do you need to solve it? How should you clean your data so your model can use it? Build a model to solve your problem? Did I solve the problem? Communicate to stakeholders or put into production?
  • 11. 11 This Lesson’s Focus: Modeling and Validation Problem Statement Data Collection Data Exploration & Preprocessing Modeling Validation Decision Making & Deployment What problem are you trying to solve? What data do you need to solve it? How should you clean your data so your model can use it? Build a model to solve your problem? Did I solve the problem? Communicate to stakeholders or put into production?
  • 13. Formulating a Supervised Learning Problem 13 For a Supervised Learning Problem: • Collect a labeled dataset (features and target labels). • Choose the model. • Choose an evaluation metric: “What to use to measure performance.” • Choose an optimization method:1 “How to find the model configuration that gives the best performance.” 1There are standard methods to use for different models and metrics.
  • 14. Decision tree Which Model? 14 There are many models that represent the problem and make decisions in different ways each with their own advantages and disadvantages. A decision tree makes predictions by asking a series of yes/no questions. Nearest neighbor makes predictions by having the most similar examples vote. Nearest neighbors
  • 15. Which Model? 15 Some considerations when choosing are: • Time needed for training • Speed in making predictions • Amount of data needed • Type of data • Problem complexity • Ability to solve a complex problem • Tendency to overcomplicate a simple one
  • 16. Accuracy target Evaluation Metric 16 There are many metrics available1 to measure performance, such as: • Accuracy: how well predictions match true values. • Mean Squared Error: average square distance between prediction and true value. 1The wrong metric can be misleading or not capture the real problem. Mean square error formula
  • 17. Evaluation Metric 17 Email The wrong metric can be misleading or not capture the real problem. For example: consider using accuracy for spam/not spam. • If 99 out of 100 emails are actually spam, then a model that is predicting spam every time will have 99% accuracy. • This may force an important real email into spam, even though it has a high accuracy metric.
  • 18. Training 18 Training Data: The dataset used to train the model. Optimization: Configures the model for best performance.
  • 19. ? Error Training 19 Forward Backward “Bicycle!” “Strawberry?” Human Bicycle Strawberry With these pieces, a model can now be trained to find the best configuration. Labeled Data Model Evaluation Metric
  • 20. Inference 20 Once the model is trained, we can provide new examples for predictions. ?????? “Bicycle!” ModelNew Data Prediction
  • 21. Training vs. Inference 21 Goal: Perform well on unseen data during inference. ?????? “Bicycle!” ? Error “Bicycle!” “Strawberry?” Human Bicycle Strawberry Model weights TrainingInference
  • 22. Supervised Learning Overview 22 Data with answers (features and labels) Model+ Trained Model Fit Data without answers (features only) Trained Model + Predicted Answer Predict Training: Train a model with known data. Inference: Feed unseen data into trained model to make predictions.
  • 24. Curve Fitting: Overfitting vs. Underfitting Example 24 X Y Goal: Fit a curve to the data.
  • 25. X Y Curve Fitting: Underfitting Example 25 The curve can be too simple. • This is called “underfitting” • Poor fit on training data • Poor fit on unseen data Underfitting: Model is missing systematic trends in data.
  • 26. X Y Curve Fitting: Overfitting Example 26 The curve can be too complex. • This is called “overfitting” • Good fit on training data • Poor fit on unseen data Overfitting: Model is too sensitive and fits the “noise” in the training data.
  • 27. Curve Fitting Problem 27 Problem: Unseen data isn’t available during training. • How can performance be estimated? When measuring performance on the training data, there is a tendency to overfit. Underfit Well fit Overfit
  • 28. 28 Solution: Split Data Into Two Sets Training Set Testing Set Training Set: Data used during the training process. Test Set: Data used to measure performance, simulating unseen data1. 1 Not used during the training process. *Other names and brands may be claimed as the property of others.
  • 29. 29 Train-Test Split Model Weights Training Data Testing Data Evaluate trained model on data it hasn’t “seen” before to simulate real-world inference. “Trained Model” Training Inference Prediction
  • 30. *Other names and brands may be claimed as the property of others.
  • 31. 31 Why Python*? • General purpose language. • Simple, readable syntax relative to other languages, such as Java* or C++. • Has a good REPL. • Can facilitate applications written in other languages, C++ and Fortran. • Active community. • Extensive libraries. *Other names and brands may be claimed as the property of others.
  • 32. 32 Python*: Fastest Growing Programming Language1 1Source: Stack Overflow *Other names and brands may be claimed as the property of others.
  • 33. 33 Python*: Highest Ranked Language1 1Source: IEEE Spectrum *Other names and brands may be claimed as the property of others.
  • 34. 34 Python* Libraries for Data Science Fast numerical computing Data analysis and manipulation Machine learning Visualization Deep Learning *Other names and brands may be claimed as the property of others.
  • 35. Intel® Distribution for Python* Easy, Out-of-the-box Access to High Performance Python* • Prebuilt, optimized for numerical computing, data analytics, High Performance Computing (HPC). • Drop in replacement for your existing Python (no code changes required). • Download from https://software.intel.com/en-us/distribution-for-python *Other names and brands may be claimed as the property of others.
  • 36. Intel® Distribution for Python* Drive Performance with Multiple Optimization Techniques • Accelerated NumPy/ SciPy / Scikit-Learn with the Intel® Math Kernel Library (Intel® MKL). • Data analytics with pyDAAL, enhanced thread scheduling with Intel® Thread Building Blocks (Intel® TBB), Jupyter* Notebook interface, Numba, Cython*. • Scale easily with optimized MPI4Py* and Jupyter* notebooks. *Other names and brands may be claimed as the property of others.
  • 37. Intel® Distribution for Python* Faster Access to Latest Optimizations for Intel® Architecture • Distribution and individual optimized packages available through Conda* and Anaconda Cloud*. • Optimizations upstreamed back to main Python* trunk. *Other names and brands may be claimed as the property of others.
  • 38. Train and Test Splitting: Syntax Import the train and test split function. from sklearn.model_selection import train_test_split Split the data and put 30% into the test set. train, test = train_test_split(data, test_size=0.3) Other method for splitting data. from sklearn.model_selection import ShuffleSplit
  • 39. Import the class containing the classification method. from sklearn.neighbors import KNeighborsClassifier Create an instance of the class. KNN = KNeighborsClassifier(n_neighbors=3) Fit the instance on the data and then predict the expected value. KNN = KNN.fit(X_data, y_data) y_predict = KNN.predict(X_data) K Nearest Neighbors: The Syntax
  • 40. 40 Learning Objectives Recap • Name the steps in the data science workflow • Explain how to formulate a supervised learning problem • Compare “Training” and “Inference” • Describe the dangers of overfitting, and training vs. testing data • Identify the advantages of the PyData* ecosystem In this lesson, we worked to: *Other names and brands may be claimed as the property of others.

Editor's Notes

  • #16: For more details refer to ML 101
  • #18: A spam email in inbox: annoying A real email in the spam folder: missing something important
  • #36: software.intel.com/intel-distribution-for-python
  • #37: software.intel.com/intel-distribution-for-python
  • #38: software.intel.com/intel-distribution-for-python