Machine
Learning
What is the Machine learning?
By Siddharth Adelkar,
People’s Archive of Rural India
Copyright
1. A general idea of what these terms mean: AI, ML, Deep Learning, NLP ?
2. How do they relate to each other?
3. To look deeper into the Machine Learning workflow
4. To install the first basic Python infrastructure for data science
experiments
5. To write our first ML program
Goals of this workship
Agenda
Let’s code!What is AI/ML? Workflow Game Your project
What is machine
learning?
What are the
steps in ML?
Learning on the
Skin MNIST
Dataset
Use ML in your
own project
01
04
Objectives Wall
What are your objectives?
AI Wall
Your understanding of the
buzzwords in AI
03
Project Wall
Do you have an application
in mind?
02
Game wall
Let’s play an ML game
OKR Wall
● What is your Objective
today?
● What are some key results
you expect?
Write on a stickie paste it.
Project Wall
One Artificial Intelligence
project idea that you want to
implement.
AI Wall
Draw a Venn Diagram
● Artificial Intelligence
● Machine Learning
● Natural Language Processing
● Digital Signal Processing
● Image Processing
● Statistics
● Deep Learning
● Neural Networks
● Blockchain
● Deepfakes
What is AI?
Write on a stickie. Paste it.
01
—John McCarthy, coined term ‘AI’[1]
“It is the science and engineering of
making intelligent machines, especially
intelligent computer programs. It is
related to the similar task of using
computers to understand human
intelligence, but AI does not have to
confine itself to methods that are
biologically observable.”
—Merriam Webster Dictionary [2]
“The capability of a
machine to imitate
intelligent human
behavior.”
Some intelligent behaviors?
What does the mind do?
Please write on your AI wall
Intelligent human behaviors?
Learning
Machine Learning
Language
Natural Language Processing
Planning & Decisions
Multi-agents, Robotics,
Operations Research
Recognition
Sensory -- Visual, Audio
Reasoning
Logical Theorist, Symbolic
Reasoning
Thinking?
Turing test
LEARNING
● Write on your wall
● Cases of learning/
Examples of learning
3 specific characterizations of Learning
Unsupervised
Finding some "structure" -
groups, dimensions,
clusters in unlabeled data
Supervised
Learn to predict a
characteristic of a thing,
given its other labels
Reinforcement
Out of scope
Humans can do these easily. Can they? How do humans do it? Let's play.
Classical programming vs Machine Learning
Credit: “Deep Learning with Python”, François Chollet
CREDITS: This presentation template was created
by Slidesgo, including icons by Flaticon, and
infographics & images by Freepik.
Concluding
Session 1
● We conclude that Mind does a large number of things.
● AI constitutes identifying these and then mimicking them
● One of these is learning. But learning itself is very large,
deep and enigmatic.
● ML focuses on specific types of learning
The Machine Learning
Workflow Game
Let’s play!
02
● Your team is given 50 cards. Shuffle
● Roll the dice. This is the number of
classes.
● Group the cards in to those many
categories using your logic.
● Write down your logic on a stickie.
Hide it. Write classes on back of
card.
● This was unsupervised learning. You
were the machine. You did the
learning and you clustered the
dataset.
You are machine
● Shuffle cards. Take out 10, 5 of
these are Dev Set. 5 rest are Test
Set.
● Now go to the stage. Face the
audience. Audience is machine.
● Train the machine. You can't talk.
You can only show the two sides of
the card.
● Epoch is when you go through all
cards.
● Too slow? Change batch size.
Audience is Machine
● Training data was not labelled.
● You did not know what you are
interested in.
● The problem at hand was
clustering in meaningful
categories
● Machine discovered features
● Machine created Clusters
● You knew what you were interested in
● You knew the i/p and o/p of Training
Data
● Problem at hand was -- given i/p,
predict o/p
● Machine predicted given past
experience.
Conclusions
Unsupervised Supervised
Why Dev Set? Bias - Variance
Credit: MartinThoma,
Wikimedia Foundation
Model Performance
Quality?
How do you evaluate model quality?
True/False X
Positive/Negative
Class = Yes Class = No
Class = Yes True Positive False Negative
Class = No False Positive True Negative
Predicted labels
True labels
Accuracy
TP+TN/TP+
FP+FN+TN
Simply, correct predictions to total
predictions.
“Wolf! Wolf! Wolf!” Accuracy = 100%
Precision
TP/TP+FP
Make sure that you don’t have too many
false positives!
“He does not have TB.” COSTLY mistake!
Recall
TP/TP+FN
Make sure you are not claiming too
many False Negatives.
F1 Score
2*(Recall * Precision)
/ (Recall + Precision)
When distribution is uneven, a
useful composite metric
Confusion Matrix
Class 1 Class 2 Class 3 Class 4
Class 1
Class 2
Class 3
Class 4
Predicted labels
True labels
Concluding Session 2
● ML Workflow
1. Preparing the dataset- structuring, cleaning
2. Creating the test, dev and train sets
3. Deciding on an architecture
4. Iterating on dataset
5. Output model
6. Test model on dev
7. Happy? No? Go back to step 3
8. Yes? Test on test set. Final quality.
● We learned how to test model quality
Buzzword Alert
Remember the hype cycle. All
great technologies with
potential go through a hype
cycle. Don’t fall prey to over
optimism. Don’t think too
pessimistically either.
4. Anaconda Navigator > Install
Jupyter Notebooks
5. On Kaggle, go to Kernels. Download
the top two kernel codes.
6. Upload and open both on Jupyter
1. Download “SkinMNIST” data
from Kaggle.
2. Anaconda (Python 3.7)
3. conda create -n keras python=3.7
numpy scipy keras matplotlib
pandas seaborn pillow
scikit-learn
03 Let’s hack!
1. Go to
http://skin.test.woza.work/
2. Upload an image of a skin
lesion
3. The model predicts likelihood of
condition
Model, what is it good for?
1. Skin Lesion Analyzer + Tensorflow.js
Web App by Marsh
https://www.kaggle.com/vbookshelf/skin-lesion-analyzer-tensorflow-js-web-app
2. Step wise Approach : CNN Model
(77.0344% Accuracy) by Manu
Siddhartha
https://www.kaggle.com/sid321axn/step-wise-approach-cnn-model-77-0344-accuracy
3. HAM100000 “SKIN MNIST” Data
https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DBW86T
Thank you kagglers
CREDITS: This presentation template was created
by Slidesgo, including icons by Flaticon, and
infographics & images by Freepik.
Thanks!
Do you have any questions?
siddharth@ruralindiaonline.org
+91 869 287 2055
https://ruralindiaonline.org

Machine Learning Workshop, TSEC 2020

  • 1.
    Machine Learning What is theMachine learning? By Siddharth Adelkar, People’s Archive of Rural India Copyright
  • 2.
    1. A generalidea of what these terms mean: AI, ML, Deep Learning, NLP ? 2. How do they relate to each other? 3. To look deeper into the Machine Learning workflow 4. To install the first basic Python infrastructure for data science experiments 5. To write our first ML program Goals of this workship
  • 3.
    Agenda Let’s code!What isAI/ML? Workflow Game Your project What is machine learning? What are the steps in ML? Learning on the Skin MNIST Dataset Use ML in your own project
  • 4.
    01 04 Objectives Wall What areyour objectives? AI Wall Your understanding of the buzzwords in AI 03 Project Wall Do you have an application in mind? 02 Game wall Let’s play an ML game
  • 5.
    OKR Wall ● Whatis your Objective today? ● What are some key results you expect? Write on a stickie paste it.
  • 6.
    Project Wall One ArtificialIntelligence project idea that you want to implement.
  • 7.
    AI Wall Draw aVenn Diagram ● Artificial Intelligence ● Machine Learning ● Natural Language Processing ● Digital Signal Processing ● Image Processing ● Statistics ● Deep Learning ● Neural Networks ● Blockchain ● Deepfakes
  • 8.
    What is AI? Writeon a stickie. Paste it. 01
  • 9.
    —John McCarthy, coinedterm ‘AI’[1] “It is the science and engineering of making intelligent machines, especially intelligent computer programs. It is related to the similar task of using computers to understand human intelligence, but AI does not have to confine itself to methods that are biologically observable.”
  • 10.
    —Merriam Webster Dictionary[2] “The capability of a machine to imitate intelligent human behavior.”
  • 11.
    Some intelligent behaviors? Whatdoes the mind do? Please write on your AI wall
  • 12.
    Intelligent human behaviors? Learning MachineLearning Language Natural Language Processing Planning & Decisions Multi-agents, Robotics, Operations Research Recognition Sensory -- Visual, Audio Reasoning Logical Theorist, Symbolic Reasoning Thinking? Turing test
  • 13.
    LEARNING ● Write onyour wall ● Cases of learning/ Examples of learning
  • 14.
    3 specific characterizationsof Learning Unsupervised Finding some "structure" - groups, dimensions, clusters in unlabeled data Supervised Learn to predict a characteristic of a thing, given its other labels Reinforcement Out of scope Humans can do these easily. Can they? How do humans do it? Let's play.
  • 15.
    Classical programming vsMachine Learning Credit: “Deep Learning with Python”, François Chollet
  • 16.
    CREDITS: This presentationtemplate was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik. Concluding Session 1 ● We conclude that Mind does a large number of things. ● AI constitutes identifying these and then mimicking them ● One of these is learning. But learning itself is very large, deep and enigmatic. ● ML focuses on specific types of learning
  • 17.
    The Machine Learning WorkflowGame Let’s play! 02
  • 18.
    ● Your teamis given 50 cards. Shuffle ● Roll the dice. This is the number of classes. ● Group the cards in to those many categories using your logic. ● Write down your logic on a stickie. Hide it. Write classes on back of card. ● This was unsupervised learning. You were the machine. You did the learning and you clustered the dataset. You are machine
  • 19.
    ● Shuffle cards.Take out 10, 5 of these are Dev Set. 5 rest are Test Set. ● Now go to the stage. Face the audience. Audience is machine. ● Train the machine. You can't talk. You can only show the two sides of the card. ● Epoch is when you go through all cards. ● Too slow? Change batch size. Audience is Machine
  • 20.
    ● Training datawas not labelled. ● You did not know what you are interested in. ● The problem at hand was clustering in meaningful categories ● Machine discovered features ● Machine created Clusters ● You knew what you were interested in ● You knew the i/p and o/p of Training Data ● Problem at hand was -- given i/p, predict o/p ● Machine predicted given past experience. Conclusions Unsupervised Supervised
  • 21.
    Why Dev Set?Bias - Variance Credit: MartinThoma, Wikimedia Foundation
  • 22.
    Model Performance Quality? How doyou evaluate model quality?
  • 23.
    True/False X Positive/Negative Class =Yes Class = No Class = Yes True Positive False Negative Class = No False Positive True Negative Predicted labels True labels
  • 24.
    Accuracy TP+TN/TP+ FP+FN+TN Simply, correct predictionsto total predictions. “Wolf! Wolf! Wolf!” Accuracy = 100%
  • 25.
    Precision TP/TP+FP Make sure thatyou don’t have too many false positives! “He does not have TB.” COSTLY mistake!
  • 26.
    Recall TP/TP+FN Make sure youare not claiming too many False Negatives.
  • 27.
    F1 Score 2*(Recall *Precision) / (Recall + Precision) When distribution is uneven, a useful composite metric
  • 28.
    Confusion Matrix Class 1Class 2 Class 3 Class 4 Class 1 Class 2 Class 3 Class 4 Predicted labels True labels
  • 29.
    Concluding Session 2 ●ML Workflow 1. Preparing the dataset- structuring, cleaning 2. Creating the test, dev and train sets 3. Deciding on an architecture 4. Iterating on dataset 5. Output model 6. Test model on dev 7. Happy? No? Go back to step 3 8. Yes? Test on test set. Final quality. ● We learned how to test model quality
  • 30.
    Buzzword Alert Remember thehype cycle. All great technologies with potential go through a hype cycle. Don’t fall prey to over optimism. Don’t think too pessimistically either.
  • 31.
    4. Anaconda Navigator> Install Jupyter Notebooks 5. On Kaggle, go to Kernels. Download the top two kernel codes. 6. Upload and open both on Jupyter 1. Download “SkinMNIST” data from Kaggle. 2. Anaconda (Python 3.7) 3. conda create -n keras python=3.7 numpy scipy keras matplotlib pandas seaborn pillow scikit-learn 03 Let’s hack!
  • 32.
    1. Go to http://skin.test.woza.work/ 2.Upload an image of a skin lesion 3. The model predicts likelihood of condition Model, what is it good for?
  • 33.
    1. Skin LesionAnalyzer + Tensorflow.js Web App by Marsh https://www.kaggle.com/vbookshelf/skin-lesion-analyzer-tensorflow-js-web-app 2. Step wise Approach : CNN Model (77.0344% Accuracy) by Manu Siddhartha https://www.kaggle.com/sid321axn/step-wise-approach-cnn-model-77-0344-accuracy 3. HAM100000 “SKIN MNIST” Data https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DBW86T Thank you kagglers
  • 34.
    CREDITS: This presentationtemplate was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik. Thanks! Do you have any questions? siddharth@ruralindiaonline.org +91 869 287 2055 https://ruralindiaonline.org