SlideShare une entreprise Scribd logo
1  sur  19
Machine Learning
with SKLearn
Omar
Alam
Yonge
Bai
Trinity
Yip
Different fields of AI:
• AI: Using machines to make human-like
decisions
○ Ex. Chatbot
• ML: Using data to “learn” features of a problem
then make predictions
○ Ex. Decision trees, Logistic regression
• DL: Using Neural networks to “learn” correct
outputs given data
○ Ex. self driving
Artificial Intelligence
Machine Learning Pipeline
What does creating a ML project look like?
1.Gathering data
2.Preprocessing data
3.Model selection
4.Training
5.Evaluation
6.Parameter tuning
7.Prediction
What is SKLearn?
Machine Learning Library
● Python library for introduction to machine learning
● Created by Google
● Provides tools for several steps of the pipeline
○ E.g turning data into information readable by the
computer
Splitting and Scaling
Minmax Normalization
● Generally, datasets attributes are on very different attributes.
○ Consider house pricing dataset: Rooms (1 - 5), Price (200k - 1mil), Age (1 - 70).
● Many methods of Normalization
○ Minmax Normalization, Log scaling, z-score
● Minmax normalization: Scale all values based on the minimum and maximum values for
each attribute.
Data Normalization
80/20 Split
● Datasets are split into two sets: Training + Validation
● Model is trained on training set.
● The accuracy is measured on validation set.
Dataset Splitting
• Many different types of ML models
• This step is to figure out which one is best
for your application
Model Selection
Important Factors
● Type of problem: Classification, Regression, etc
● Type of data: images, text, numerical, audio
● How much data
Math/Theory Behind Log Reg
● Logistic function is just a sigmoid function.
○ Used for classification and regression.
● Better suited for non-linear datasets.
● The function can be used as a probability
Function when L = 1;
Training
Gradient Descent
● Gradient Descent is a first order optimization function.
○ Function has to be convex and differentiable.
● Gradient is the derivative of a function.
○ Just the derivative of a function f(x).
○ N-Vector for f(x1, x2, x3, ….., xn)
● Used to minimize error using gradient and learning rate.
○ Learning rate defines how fast the model learns
Cost Function
● Cost function is a “loss function”
● A loss function define the error between
predictions and actual values.
● We can use the log loss function for logistic regression.
Training
Evaluation
Selecting Evaluation Metrics
- Used to measure the quality of
model
- Different evaluation metric can skew
your perception of model
performance
- Selecting the incorrect metric will
make your model optimize
incorrectly
Example Dataset
Total Patients: 10
Deaths: 1
Model’s prediction: nobody passes away
Our useless model seems pretty good
Parameter Tuning
- Hyperparameters are the fine details of model
- Initially assumed values
Examples of Hyperparameters:
- Number of Iterations
- Regularization
Tune Hyperparameters
Grid Search: Tests all the
parameters combinations
(Can take a long time)
Randomized Search: Test random
combinations of the parameters
(Can be faster)
Grid Search and Randomized Search
What’s the difference? Who cares?
Resources
- https://scikit-learn.org/stable/index.html SKLearn Docs
- https://www.oreilly.com/library/view/hands-on-machine-
learning/9781492032632/ Popular textbook for machine learning
Youtube Channels
- https://www.youtube.com/user/sentdex
- https://www.youtube.com/user/keeroyz
- https://www.youtube.com/@YannicKilcher
Stable Diffusion
https://creator.nightcafe.studio/create/text-to-image?algo=stable
DALL E Mini
https://www.craiyon.com/

Contenu connexe

Similaire à SKLearn Workshop.pptx

30thSep2014
30thSep201430thSep2014
30thSep2014
Mia liu
 

Similaire à SKLearn Workshop.pptx (20)

10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems10 more lessons learned from building Machine Learning systems
10 more lessons learned from building Machine Learning systems
 
Introduction to Machine Learning with Spark
Introduction to Machine Learning with SparkIntroduction to Machine Learning with Spark
Introduction to Machine Learning with Spark
 
30thSep2014
30thSep201430thSep2014
30thSep2014
 
Introduction to machine learning and applications (1)
Introduction to machine learning and applications (1)Introduction to machine learning and applications (1)
Introduction to machine learning and applications (1)
 
Stock market analysis using supervised machine learning
Stock market analysis using supervised machine learningStock market analysis using supervised machine learning
Stock market analysis using supervised machine learning
 
Deep learning crash course
Deep learning crash courseDeep learning crash course
Deep learning crash course
 
Aws autopilot
Aws autopilotAws autopilot
Aws autopilot
 
Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies Machine Learning and Deep Learning 4 dummies
Machine Learning and Deep Learning 4 dummies
 
Machine learning4dummies
Machine learning4dummiesMachine learning4dummies
Machine learning4dummies
 
VSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 SessionsVSSML17 Review. Summary Day 2 Sessions
VSSML17 Review. Summary Day 2 Sessions
 
Overview of machine learning
Overview of machine learning Overview of machine learning
Overview of machine learning
 
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topicMachine Learning: Artificial Intelligence isn't just a Science Fiction topic
Machine Learning: Artificial Intelligence isn't just a Science Fiction topic
 
Machine learning using matlab.pdf
Machine learning using matlab.pdfMachine learning using matlab.pdf
Machine learning using matlab.pdf
 
MLlib and Machine Learning on Spark
MLlib and Machine Learning on SparkMLlib and Machine Learning on Spark
MLlib and Machine Learning on Spark
 
Scaling Recommendations at Quora (RecSys talk 9/16/2016)
Scaling Recommendations at Quora (RecSys talk 9/16/2016)Scaling Recommendations at Quora (RecSys talk 9/16/2016)
Scaling Recommendations at Quora (RecSys talk 9/16/2016)
 
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
Machine Learning: Inteligencia Artificial no es sólo un tema de Ciencia Ficci...
 
Pycon 2012 Scikit-Learn
Pycon 2012 Scikit-LearnPycon 2012 Scikit-Learn
Pycon 2012 Scikit-Learn
 
AI hype or reality
AI  hype or realityAI  hype or reality
AI hype or reality
 
Machine learning pipeline with spark ml
Machine learning pipeline with spark mlMachine learning pipeline with spark ml
Machine learning pipeline with spark ml
 
BSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 SessionsBSSML16 L10. Summary Day 2 Sessions
BSSML16 L10. Summary Day 2 Sessions
 

Plus de fsxflyer789Productio (7)

Behind the Scenes of ChatGPT.pptx
Behind the Scenes of ChatGPT.pptxBehind the Scenes of ChatGPT.pptx
Behind the Scenes of ChatGPT.pptx
 
GDSC Git event 2023.pptx
GDSC Git event 2023.pptxGDSC Git event 2023.pptx
GDSC Git event 2023.pptx
 
OpenCV with Python
OpenCV with PythonOpenCV with Python
OpenCV with Python
 
An introduction to blockchain
An introduction to blockchainAn introduction to blockchain
An introduction to blockchain
 
Building robots with Robot Operating System (ROS)
Building robots with Robot Operating System (ROS)Building robots with Robot Operating System (ROS)
Building robots with Robot Operating System (ROS)
 
GDSC x Fintech Algorithmic Investing event
GDSC x Fintech Algorithmic Investing eventGDSC x Fintech Algorithmic Investing event
GDSC x Fintech Algorithmic Investing event
 
Unity workshop
Unity workshopUnity workshop
Unity workshop
 

Dernier

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
only4webmaster01
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 

SKLearn Workshop.pptx

  • 2. Different fields of AI: • AI: Using machines to make human-like decisions ○ Ex. Chatbot • ML: Using data to “learn” features of a problem then make predictions ○ Ex. Decision trees, Logistic regression • DL: Using Neural networks to “learn” correct outputs given data ○ Ex. self driving Artificial Intelligence
  • 3. Machine Learning Pipeline What does creating a ML project look like? 1.Gathering data 2.Preprocessing data 3.Model selection 4.Training 5.Evaluation 6.Parameter tuning 7.Prediction
  • 4. What is SKLearn? Machine Learning Library ● Python library for introduction to machine learning ● Created by Google ● Provides tools for several steps of the pipeline ○ E.g turning data into information readable by the computer
  • 6. Minmax Normalization ● Generally, datasets attributes are on very different attributes. ○ Consider house pricing dataset: Rooms (1 - 5), Price (200k - 1mil), Age (1 - 70). ● Many methods of Normalization ○ Minmax Normalization, Log scaling, z-score ● Minmax normalization: Scale all values based on the minimum and maximum values for each attribute. Data Normalization
  • 7. 80/20 Split ● Datasets are split into two sets: Training + Validation ● Model is trained on training set. ● The accuracy is measured on validation set. Dataset Splitting
  • 8. • Many different types of ML models • This step is to figure out which one is best for your application Model Selection Important Factors ● Type of problem: Classification, Regression, etc ● Type of data: images, text, numerical, audio ● How much data
  • 9. Math/Theory Behind Log Reg ● Logistic function is just a sigmoid function. ○ Used for classification and regression. ● Better suited for non-linear datasets. ● The function can be used as a probability Function when L = 1;
  • 10. Training Gradient Descent ● Gradient Descent is a first order optimization function. ○ Function has to be convex and differentiable. ● Gradient is the derivative of a function. ○ Just the derivative of a function f(x). ○ N-Vector for f(x1, x2, x3, ….., xn) ● Used to minimize error using gradient and learning rate. ○ Learning rate defines how fast the model learns
  • 11. Cost Function ● Cost function is a “loss function” ● A loss function define the error between predictions and actual values. ● We can use the log loss function for logistic regression. Training
  • 12. Evaluation Selecting Evaluation Metrics - Used to measure the quality of model - Different evaluation metric can skew your perception of model performance - Selecting the incorrect metric will make your model optimize incorrectly
  • 13. Example Dataset Total Patients: 10 Deaths: 1 Model’s prediction: nobody passes away
  • 14. Our useless model seems pretty good
  • 15.
  • 16. Parameter Tuning - Hyperparameters are the fine details of model - Initially assumed values Examples of Hyperparameters: - Number of Iterations - Regularization Tune Hyperparameters
  • 17. Grid Search: Tests all the parameters combinations (Can take a long time) Randomized Search: Test random combinations of the parameters (Can be faster) Grid Search and Randomized Search What’s the difference? Who cares?
  • 18.
  • 19. Resources - https://scikit-learn.org/stable/index.html SKLearn Docs - https://www.oreilly.com/library/view/hands-on-machine- learning/9781492032632/ Popular textbook for machine learning Youtube Channels - https://www.youtube.com/user/sentdex - https://www.youtube.com/user/keeroyz - https://www.youtube.com/@YannicKilcher Stable Diffusion https://creator.nightcafe.studio/create/text-to-image?algo=stable DALL E Mini https://www.craiyon.com/