SlideShare a Scribd company logo
Ruby Shrestha
THE ABC OF IMPLEMENTING
SUPERVISED ML WITH
PYTHON
| MACHINE LEARNING |
A computer program is said to 'learn' from experience E with respect to some
class of tasks T and performance measure P, if its performance at tasks in T, as
measured by P, improves with experience E.
(source: Wiki)
• Task (T): recognizing and classifying handwritten words within images
• Performance measure (P): percent of words correctly classified
• Training experience (E): a database of handwritten words with given
classifications
OFFICIAL DEFINITION OF
MACHINE LEARNING (ML)
• Sample: Any item to classify. Example, picture, doc, row of DB or CSV file, an audio or video
clip
• Training Set: set of data from which predictive relationship is developed by the system
• Testing Set: set of data whose predictions is to be made by the system or result
automatically derived
• Features: Distinct traits to describe each item in a quantitative manner
• Feature Vector: n-dimensional vector of quantitative features
• Label Vector: 1-dimensional vector of label values / classes, which identify each row of
feature vector (in case of supervised learning)
• Feature Extraction: preparation of Feature Vector and Label Vector
TERMINOLOGIES
EXAMPLE
● Given above is the training set.
● Petal width, petal length, sepal width, sepal length are the features from which we can
create feature vector.
● Species name is the label from which we can create label vector.
● Each row is the sample we have.
● A number of samples form training set, used to train machine. Similarly, other group of
similar samples form testing test for the purpose of testing the accuracy.
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
TYPES OF MACHINE LEARNING
TYPES OF SUPERVISED ML
Regression Classification
Fig: Linear Regression
Source: http://ci.columbia.edu
Fig: 3- Class Leaf Species Classification
Source: https://astrobites.org
WORKFLOW OF SUPERVISED ML
Source: NLTK
• Download and Install Python (Basically, sudo apt-get install python3)
• Any IDE: Example, PyCharm (https://itsfoss.com/install-pycharm-ubuntu/)
• Important Python libraries to install (using, pip module):
✓ Numpy: n-dimensional array creation and array related functionalities (pip install numpy)
✓ Scipy: scientific operations (linear algebra, integration, signal and img processing) (pip install scipy)
✓ Matplotlib: plotting figures (pip install matplotlib)
✓ Pandas: high level data manipulation (groupby, merge, join, time series data manipulation) (pip install
pandas)
✓ Sklearn: Machine Learning algorithms (pip install scikit-learn)
• Topic Related Dataset
PREREQUISITES
Usual Method
a = 83;
b = -2;
c = a + b;
A Different Contemporary Approach
“MACHINE LEARNING”
MAKE A MACHINE LEARN TO ADD
LDA A Load operand from location A 0010 0001 0000 0100
ADD B Add operand from location B 0001 0001 0000 0101
STA C Store sum in location C 0011 0001 0000 0110
1. Import required libraries using import statement.
• Example: for importing scikit-learn,
• import sklearn
• import sklearn as sk
• from sklearn.linear_model import LinearRegression
ADDING TWO NUMBERS BASED ON ML
2. Load the dataset.
ADDING TWO NUMBERS BASED ON ML
6 x 3 array
3. Create Feature Set and Label Set.
ADDING TWO NUMBERS BASED ON ML
6 x 2 array
1-d array
// Feature Set
// Label Set
Data Summarization and Visualization
using functions of matplotlib or other
suitable module.
Here, not required
X
4. Choose an appropriate Machine Learning algorithm
According to docs.microsoft.com:
It depends on:
• size, quality, and nature of the data.
• what you want to do with the answer.
• how the math of the algorithm was translated
• how much time you have.
• complexity of the problem at hand.
“Even the most experienced data scientists can't tell which algorithm will
perform best before trying them; however, they can certainly give a strong
hypothesis. ”
ADDING TWO NUMBERS BASED ON ML
5. Create an instance of ML Algorithm so chosen.
How does it work?
Given: x1 and x2 as two numbers to sum and y as result. In Linear Regression:
y=a∗x1+b∗x2+c
For a simple addition the coefficient we are looking for are:
a = 1, b = 1 and c = 0
But here we want the AI to figure it out by itself. So, we just feed it with some
examples ( 2+3=5 , 1+5=6)
ADDING TWO NUMBERS BASED ON ML
6. Fit the linear regression model with the training data.
Fit function finds coefficients required to create a trained model.
Output
ADDING TWO NUMBERS BASED ON ML
7. We’re almost done now ☺ Now we just need to test the trained system
to find summations of two test numbers.
Output
ADDING TWO NUMBERS BASED ON ML
8. Finally, if interested we can find accuracy of the system using
mathematical calculation (accuracy= correct / total) or accuracy_score
function of sklearn.metrics module.
Output
ADDING TWO NUMBERS BASED ON ML
1. Import required libraries using import statement.
2. Load the dataset.
3. Create Feature Set and Label Set.
4. Choose an appropriate Machine Learning algorithm.
5. Create an instance of ML Algorithm so chosen.
6. Fit the model with the training data.
7. Test the system for result.
8. Finally, if interested, find accuracy of the system using mathematical calculation
(accuracy= correct / total) or accuracy_score function of sklearn.metrics
module.
THE OVERALL STEPS NOW
Supervised Machine Learning
Classification Problem
IN THE NEXT PRESENTATION SESSION
THANK YOU
Ad

Recommended

Introduction to Machine Learning with Python and scikit-learn
Introduction to Machine Learning with Python and scikit-learn
Matt Hagy
 
Introduction to Machine Learning in Python using Scikit-Learn
Introduction to Machine Learning in Python using Scikit-Learn
Amol Agrawal
 
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
MLconf
 
Scikit-Learn: Machine Learning in Python
Scikit-Learn: Machine Learning in Python
Microsoft
 
OpenML 2019
OpenML 2019
Joaquin Vanschoren
 
Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf ATL 2016
Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf ATL 2016
MLconf
 
Tensor flow
Tensor flow
Nikhil Krishna Nair
 
Unsupervised Learning: Clustering
Unsupervised Learning: Clustering
Experfy
 
OpenML NeurIPS2018
OpenML NeurIPS2018
Joaquin Vanschoren
 
Intellectual technologies
Intellectual technologies
Polad Saruxanov
 
Pybcn machine learning for dummies with python
Pybcn machine learning for dummies with python
Javier Arias Losada
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Arnaud Joly
 
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
MLconf
 
Exposé Ontology
Exposé Ontology
Joaquin Vanschoren
 
Support Vector Machine (Classification) - Step by Step
Support Vector Machine (Classification) - Step by Step
Manish nath choudhary
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
MLconf
 
Introduction to FreeMat
Introduction to FreeMat
Ahmad AlMowaffak
 
AutoML lectures (ACDL 2019)
AutoML lectures (ACDL 2019)
Joaquin Vanschoren
 
Clustering: A Scikit Learn Tutorial
Clustering: A Scikit Learn Tutorial
Damian R. Mingle, MBA
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
Rebecca Bilbro
 
Machine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlow
DataWorks Summit/Hadoop Summit
 
Dm part03 neural-networks-homework
Dm part03 neural-networks-homework
okeee
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning
Rebecca Bilbro
 
Visualizing the model selection process
Visualizing the model selection process
Rebecca Bilbro
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scale
Rebecca Bilbro
 
Methods for meta learning in AutoML
Methods for meta learning in AutoML
Mohamed Maher
 
Tensorflowv5.0
Tensorflowv5.0
Sanjib Basak
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple steps
Renjith M P
 
Machine learning
Machine learning
Sukhwinder Singh
 

More Related Content

What's hot (20)

OpenML NeurIPS2018
OpenML NeurIPS2018
Joaquin Vanschoren
 
Intellectual technologies
Intellectual technologies
Polad Saruxanov
 
Pybcn machine learning for dummies with python
Pybcn machine learning for dummies with python
Javier Arias Losada
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Arnaud Joly
 
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
MLconf
 
Exposé Ontology
Exposé Ontology
Joaquin Vanschoren
 
Support Vector Machine (Classification) - Step by Step
Support Vector Machine (Classification) - Step by Step
Manish nath choudhary
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
MLconf
 
Introduction to FreeMat
Introduction to FreeMat
Ahmad AlMowaffak
 
AutoML lectures (ACDL 2019)
AutoML lectures (ACDL 2019)
Joaquin Vanschoren
 
Clustering: A Scikit Learn Tutorial
Clustering: A Scikit Learn Tutorial
Damian R. Mingle, MBA
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
Rebecca Bilbro
 
Machine Intelligence at Google Scale: TensorFlow
Machine Intelligence at Google Scale: TensorFlow
DataWorks Summit/Hadoop Summit
 
Dm part03 neural-networks-homework
Dm part03 neural-networks-homework
okeee
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning
Rebecca Bilbro
 
Visualizing the model selection process
Visualizing the model selection process
Rebecca Bilbro
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scale
Rebecca Bilbro
 
Methods for meta learning in AutoML
Methods for meta learning in AutoML
Mohamed Maher
 
Tensorflowv5.0
Tensorflowv5.0
Sanjib Basak
 
Intellectual technologies
Intellectual technologies
Polad Saruxanov
 
Pybcn machine learning for dummies with python
Pybcn machine learning for dummies with python
Javier Arias Losada
 
Introduction to Machine Learning with SciKit-Learn
Introduction to Machine Learning with SciKit-Learn
Benjamin Bengfort
 
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Numerical tour in the Python eco-system: Python, NumPy, scikit-learn
Arnaud Joly
 
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
Dr. Erin LeDell, Machine Learning Scientist, H2O.ai at MLconf SEA - 5/20/16
MLconf
 
Support Vector Machine (Classification) - Step by Step
Support Vector Machine (Classification) - Step by Step
Manish nath choudhary
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
MLconf
 
Yellowbrick: Steering machine learning with visual transformers
Yellowbrick: Steering machine learning with visual transformers
Rebecca Bilbro
 
Dm part03 neural-networks-homework
Dm part03 neural-networks-homework
okeee
 
(Py)testing the Limits of Machine Learning
(Py)testing the Limits of Machine Learning
Rebecca Bilbro
 
Visualizing the model selection process
Visualizing the model selection process
Rebecca Bilbro
 
EuroSciPy 2019: Visual diagnostics at scale
EuroSciPy 2019: Visual diagnostics at scale
Rebecca Bilbro
 
Methods for meta learning in AutoML
Methods for meta learning in AutoML
Mohamed Maher
 

Similar to The ABC of Implementing Supervised Machine Learning with Python.pptx (20)

Start machine learning in 5 simple steps
Start machine learning in 5 simple steps
Renjith M P
 
Machine learning
Machine learning
Sukhwinder Singh
 
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET Journal
 
Keynote at IWLS 2017
Keynote at IWLS 2017
Manish Pandey
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it works
Kevin Lee
 
Getting started with Machine Learning
Getting started with Machine Learning
Gaurav Bhalotia
 
supervised.pptx
supervised.pptx
MohamedSaied316569
 
A_short_brief_on_Machine-Learning's and there types
A_short_brief_on_Machine-Learning's and there types
Tayyaba Amber
 
S2 NIGHT SKILL.pptx
S2 NIGHT SKILL.pptx
yashaswinic11
 
S2 NIGHT SKILL.pptx
S2 NIGHT SKILL.pptx
YashaswiniChandrappa1
 
Hands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearn
avrtraining021
 
Machine learning and_nlp
Machine learning and_nlp
ankit_ppt
 
Classification: MNIST, training a Binary classifier, performance measure, mul...
Classification: MNIST, training a Binary classifier, performance measure, mul...
BMS Institute of Technology and Management
 
Yulia Honcharenko "Application of metric learning for logo recognition"
Yulia Honcharenko "Application of metric learning for logo recognition"
Fwdays
 
Machine learning.docx
Machine learning.docx
BanasthaliStudent
 
Ml programming with python
Ml programming with python
Kumud Arora
 
How to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make Predictions
Developer Helps
 
Lecture-6-7.pptx
Lecture-6-7.pptx
JohnMichaelPadernill
 
Intro to Machine Learning for non-Data Scientists
Intro to Machine Learning for non-Data Scientists
Parinaz Ameri
 
Introduction to ML_Data Preprocessing.pptx
Introduction to ML_Data Preprocessing.pptx
mousmiin
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple steps
Renjith M P
 
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET Journal
 
Keynote at IWLS 2017
Keynote at IWLS 2017
Manish Pandey
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it works
Kevin Lee
 
Getting started with Machine Learning
Getting started with Machine Learning
Gaurav Bhalotia
 
A_short_brief_on_Machine-Learning's and there types
A_short_brief_on_Machine-Learning's and there types
Tayyaba Amber
 
Hands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearn
avrtraining021
 
Machine learning and_nlp
Machine learning and_nlp
ankit_ppt
 
Classification: MNIST, training a Binary classifier, performance measure, mul...
Classification: MNIST, training a Binary classifier, performance measure, mul...
BMS Institute of Technology and Management
 
Yulia Honcharenko "Application of metric learning for logo recognition"
Yulia Honcharenko "Application of metric learning for logo recognition"
Fwdays
 
Ml programming with python
Ml programming with python
Kumud Arora
 
How to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make Predictions
Developer Helps
 
Intro to Machine Learning for non-Data Scientists
Intro to Machine Learning for non-Data Scientists
Parinaz Ameri
 
Introduction to ML_Data Preprocessing.pptx
Introduction to ML_Data Preprocessing.pptx
mousmiin
 
Ad

Recently uploaded (20)

Presentation about the current products.pptx
Presentation about the current products.pptx
ikrammustafa51
 
How to Write a Powerful Resume for Career Development?
How to Write a Powerful Resume for Career Development?
StrengthsTheatre
 
From reducing flood risks to conserving water
From reducing flood risks to conserving water
Ali Ata
 
10-Circuit-Packet and completed the .ppt
10-Circuit-Packet and completed the .ppt
nabeehmohammedtaher
 
physical_hazard.ppt-, sixjirixiifrr8fifk4kfickfkjk
physical_hazard.ppt-, sixjirixiifrr8fifk4kfickfkjk
ShrawanKumarTiwari
 
Yellow and Purple Doodle Startup Pitch Deck Presentation.pdf.pdf
Yellow and Purple Doodle Startup Pitch Deck Presentation.pdf.pdf
kharadeshreya2210
 
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
rnkaushal2
 
Pakistan Economy presentation pakistan.pptx
Pakistan Economy presentation pakistan.pptx
ikrammustafa51
 
Spotting Red Flags in Financial Statements.pdf
Spotting Red Flags in Financial Statements.pdf
Matthew Denegre
 
3. Job Attitude & Job Satisfaction. .ppt
3. Job Attitude & Job Satisfaction. .ppt
obaidullah200107153
 
How Build a Personal Brand Legacy for Career Growth?
How Build a Personal Brand Legacy for Career Growth?
StrengthsTheatre
 
Power BI Jobs in Jaipur Your Gateway to Data Analytics Careers in Rajasthan.pdf
Power BI Jobs in Jaipur Your Gateway to Data Analytics Careers in Rajasthan.pdf
vinay salarite
 
Capstone project review ppt project review
Capstone project review ppt project review
keshiba1238
 
ai er make you happy ander The shor of morning.pptx
ai er make you happy ander The shor of morning.pptx
sartusorde
 
Plant Evaluation and Historical Developments,PPT.pptx
Plant Evaluation and Historical Developments,PPT.pptx
7300511143
 
Nsqf vhse admission career guidance kerala
Nsqf vhse admission career guidance kerala
anjaliparvathy2000
 
complete guide for youtube tv and creators
complete guide for youtube tv and creators
dpknihal
 
Current Affairs for Prelims (Schemes) 2024 (1).pptx
Current Affairs for Prelims (Schemes) 2024 (1).pptx
malavikasprinklr
 
Corporate Philanthropy’s Impact on Communities.pdf
Corporate Philanthropy’s Impact on Communities.pdf
Hassan Dakhlallah
 
Quarter 3 Program Implementation Review and Performance Assessment
Quarter 3 Program Implementation Review and Performance Assessment
LaMariaAngelicaPunay
 
Presentation about the current products.pptx
Presentation about the current products.pptx
ikrammustafa51
 
How to Write a Powerful Resume for Career Development?
How to Write a Powerful Resume for Career Development?
StrengthsTheatre
 
From reducing flood risks to conserving water
From reducing flood risks to conserving water
Ali Ata
 
10-Circuit-Packet and completed the .ppt
10-Circuit-Packet and completed the .ppt
nabeehmohammedtaher
 
physical_hazard.ppt-, sixjirixiifrr8fifk4kfickfkjk
physical_hazard.ppt-, sixjirixiifrr8fifk4kfickfkjk
ShrawanKumarTiwari
 
Yellow and Purple Doodle Startup Pitch Deck Presentation.pdf.pdf
Yellow and Purple Doodle Startup Pitch Deck Presentation.pdf.pdf
kharadeshreya2210
 
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
rnkaushal2
 
Pakistan Economy presentation pakistan.pptx
Pakistan Economy presentation pakistan.pptx
ikrammustafa51
 
Spotting Red Flags in Financial Statements.pdf
Spotting Red Flags in Financial Statements.pdf
Matthew Denegre
 
3. Job Attitude & Job Satisfaction. .ppt
3. Job Attitude & Job Satisfaction. .ppt
obaidullah200107153
 
How Build a Personal Brand Legacy for Career Growth?
How Build a Personal Brand Legacy for Career Growth?
StrengthsTheatre
 
Power BI Jobs in Jaipur Your Gateway to Data Analytics Careers in Rajasthan.pdf
Power BI Jobs in Jaipur Your Gateway to Data Analytics Careers in Rajasthan.pdf
vinay salarite
 
Capstone project review ppt project review
Capstone project review ppt project review
keshiba1238
 
ai er make you happy ander The shor of morning.pptx
ai er make you happy ander The shor of morning.pptx
sartusorde
 
Plant Evaluation and Historical Developments,PPT.pptx
Plant Evaluation and Historical Developments,PPT.pptx
7300511143
 
Nsqf vhse admission career guidance kerala
Nsqf vhse admission career guidance kerala
anjaliparvathy2000
 
complete guide for youtube tv and creators
complete guide for youtube tv and creators
dpknihal
 
Current Affairs for Prelims (Schemes) 2024 (1).pptx
Current Affairs for Prelims (Schemes) 2024 (1).pptx
malavikasprinklr
 
Corporate Philanthropy’s Impact on Communities.pdf
Corporate Philanthropy’s Impact on Communities.pdf
Hassan Dakhlallah
 
Quarter 3 Program Implementation Review and Performance Assessment
Quarter 3 Program Implementation Review and Performance Assessment
LaMariaAngelicaPunay
 
Ad

The ABC of Implementing Supervised Machine Learning with Python.pptx

  • 1. Ruby Shrestha THE ABC OF IMPLEMENTING SUPERVISED ML WITH PYTHON
  • 3. A computer program is said to 'learn' from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E. (source: Wiki) • Task (T): recognizing and classifying handwritten words within images • Performance measure (P): percent of words correctly classified • Training experience (E): a database of handwritten words with given classifications OFFICIAL DEFINITION OF MACHINE LEARNING (ML)
  • 4. • Sample: Any item to classify. Example, picture, doc, row of DB or CSV file, an audio or video clip • Training Set: set of data from which predictive relationship is developed by the system • Testing Set: set of data whose predictions is to be made by the system or result automatically derived • Features: Distinct traits to describe each item in a quantitative manner • Feature Vector: n-dimensional vector of quantitative features • Label Vector: 1-dimensional vector of label values / classes, which identify each row of feature vector (in case of supervised learning) • Feature Extraction: preparation of Feature Vector and Label Vector TERMINOLOGIES
  • 5. EXAMPLE ● Given above is the training set. ● Petal width, petal length, sepal width, sepal length are the features from which we can create feature vector. ● Species name is the label from which we can create label vector. ● Each row is the sample we have. ● A number of samples form training set, used to train machine. Similarly, other group of similar samples form testing test for the purpose of testing the accuracy.
  • 6. • Supervised Learning • Unsupervised Learning • Reinforcement Learning TYPES OF MACHINE LEARNING
  • 7. TYPES OF SUPERVISED ML Regression Classification Fig: Linear Regression Source: http://ci.columbia.edu Fig: 3- Class Leaf Species Classification Source: https://astrobites.org
  • 8. WORKFLOW OF SUPERVISED ML Source: NLTK
  • 9. • Download and Install Python (Basically, sudo apt-get install python3) • Any IDE: Example, PyCharm (https://itsfoss.com/install-pycharm-ubuntu/) • Important Python libraries to install (using, pip module): ✓ Numpy: n-dimensional array creation and array related functionalities (pip install numpy) ✓ Scipy: scientific operations (linear algebra, integration, signal and img processing) (pip install scipy) ✓ Matplotlib: plotting figures (pip install matplotlib) ✓ Pandas: high level data manipulation (groupby, merge, join, time series data manipulation) (pip install pandas) ✓ Sklearn: Machine Learning algorithms (pip install scikit-learn) • Topic Related Dataset PREREQUISITES
  • 10. Usual Method a = 83; b = -2; c = a + b; A Different Contemporary Approach “MACHINE LEARNING” MAKE A MACHINE LEARN TO ADD LDA A Load operand from location A 0010 0001 0000 0100 ADD B Add operand from location B 0001 0001 0000 0101 STA C Store sum in location C 0011 0001 0000 0110
  • 11. 1. Import required libraries using import statement. • Example: for importing scikit-learn, • import sklearn • import sklearn as sk • from sklearn.linear_model import LinearRegression ADDING TWO NUMBERS BASED ON ML
  • 12. 2. Load the dataset. ADDING TWO NUMBERS BASED ON ML 6 x 3 array
  • 13. 3. Create Feature Set and Label Set. ADDING TWO NUMBERS BASED ON ML 6 x 2 array 1-d array // Feature Set // Label Set Data Summarization and Visualization using functions of matplotlib or other suitable module. Here, not required X
  • 14. 4. Choose an appropriate Machine Learning algorithm According to docs.microsoft.com: It depends on: • size, quality, and nature of the data. • what you want to do with the answer. • how the math of the algorithm was translated • how much time you have. • complexity of the problem at hand. “Even the most experienced data scientists can't tell which algorithm will perform best before trying them; however, they can certainly give a strong hypothesis. ” ADDING TWO NUMBERS BASED ON ML
  • 15. 5. Create an instance of ML Algorithm so chosen. How does it work? Given: x1 and x2 as two numbers to sum and y as result. In Linear Regression: y=a∗x1+b∗x2+c For a simple addition the coefficient we are looking for are: a = 1, b = 1 and c = 0 But here we want the AI to figure it out by itself. So, we just feed it with some examples ( 2+3=5 , 1+5=6) ADDING TWO NUMBERS BASED ON ML
  • 16. 6. Fit the linear regression model with the training data. Fit function finds coefficients required to create a trained model. Output ADDING TWO NUMBERS BASED ON ML
  • 17. 7. We’re almost done now ☺ Now we just need to test the trained system to find summations of two test numbers. Output ADDING TWO NUMBERS BASED ON ML
  • 18. 8. Finally, if interested we can find accuracy of the system using mathematical calculation (accuracy= correct / total) or accuracy_score function of sklearn.metrics module. Output ADDING TWO NUMBERS BASED ON ML
  • 19. 1. Import required libraries using import statement. 2. Load the dataset. 3. Create Feature Set and Label Set. 4. Choose an appropriate Machine Learning algorithm. 5. Create an instance of ML Algorithm so chosen. 6. Fit the model with the training data. 7. Test the system for result. 8. Finally, if interested, find accuracy of the system using mathematical calculation (accuracy= correct / total) or accuracy_score function of sklearn.metrics module. THE OVERALL STEPS NOW
  • 20. Supervised Machine Learning Classification Problem IN THE NEXT PRESENTATION SESSION