SlideShare a Scribd company logo
Machine Learning and
A Walk through School Exams!
Introduction to
Artificial Intelligence
SPEAKER IMAGE
Ramsha Siddiqui
Associate Data Scientist (NLP)
i2c inc. Lahore, Pakistan
● 💬 Conversational AI and Dialog Systems.
● 👩💻 Google Developers Group, Lahore.
● 🥇 WTM and WDA Scholar, 2018-2020.
● 🎓 FAST NUCES, Lahore - Spring, 2019.
● ✈️ Global UGRAD Alumnus - UIW, Texas.
● 💼 Co-Founder of Startup - FunKadaa.
What is Machine Learning?
Machine Learning is the application of
Artificial Intelligence that allows machines to
learn and improve from experience, without
being explicitly programmed, to solve almost
any problem in the world.
How do humans learn?
The Life of a Student
1. Gather Knowledge
The Life of a Student
1. Gather Knowledge 2. Extract Concepts
The Life of a Student
2. Extract Concepts
3. Practice Concepts
1. Gather Knowledge
The Life of a Student
3. Practice Concepts 4. Test Yourself
1. Gather Knowledge 2. Extract Concepts
Learning Chess!
3. Practice 4. Compete!
1. Learn Pieces and Moves 2. Understand & Memorize
How do machines learn?
1. Gather Training Data
The initial set of data-points required to learn
about a problem, in order to solve it.
2. Data Preprocessing
Analyzing Data and Extracting or Deriving useful
features from it, in efforts to improve results.
Why is it important?
3. Model Selection / Construction
An algorithm / mathematical derivation
containing variables that can be derived /
learned from Training Data is called a
Machine Learning Model.
The values of the variables are saved after
training to be used for predictions later.
3. Model Selection / Construction
Selecting the right “kind of model” for your
Machine Learning is also important, because
feature-learning / data-understanding is an
internal process for machines, and certain
types of problems are more well-suited for
certain types of algorithms.
Let’s look at the two broadest types!
Supervised
Learning
When a Model’s Expected
Outputs are defined, it’s called a
Supervised Learning Problem. It
mainly has two sub-categories:
● Classification (categorizing
input data into classes)
● Regression (predicting a
continuous / real value instead
of an output class-label)
Example: Facial Recognition
Recognizing people’s faces and its features (eyes, head-pose, etc.)
Example: Facial Recognition
Convolutional Neural Networks (CNNs) have been classically useful for
the task of identifying different components / features of images.
Example: Speech Recognition
Converting Audio Sequences
(Speech) into Text Sequences.
Example: Speech Recognition
Sequence to Sequence Networks (Seq2Seq) have so far shown
promising results for this task (with updated research and
architectures being released almost every day!)
Example: Covid Projection
Predicting the number of Covid-Cases every other day / month.
Example: Covid Projection
Time-Series Forecasting is a common problem in Machine Learning,
and all models used for that task, can be trained here for comparison.
A Note: Some of these problems such as
● Image Classification
● Text Classification, etc.
you’ll find that some Model Architectures are also problem-
favorable, as they’ve shown good results before. It’s always
wise for you to do some Research beforehand to find
good Model Implementations / Datasets on the task you’re
working on, before starting from scratch.
Unsupervised
Learning
When a Model’s Expected
Outputs are undefined, and
input-data only needs to be
clustered or segmented into
somewhat meaningful groups, it’s
called Unsupervised Learning.
Example:
● K-Means Algorithm (Finds
Cluster Centroids based on
the no. of centers defined = K)
Example: Topic Modeling
Training a model to learn the topic of a document based on the correlations of
different words used inside it, without knowing prior what those topics are.
A Note: Know your Problem Domain!
4. Model Training
Feeding your Input Data to your Model for learning - is
called Model Training. Here’s some things you may wanna
do before that:
● Data Folds: Splitting your Training Data into two sets:
One for Training on, and one for Validating
Performance.
● Epochs: The number of times your model sees the
Training Data (revising it).
● Model Parameters: Take out a set of possible
parameter values that you want to tweak in your model.
Example: w1*x1 + w2*x2 + w3*x3 = y
where for every example, we have input-values “x” and model-variables
“w”.
5. Model Testing
Alas, models can’t escape examinations either. After Training a Model, we want
to see Model Predictions, and compare the values that model got with those it
got incorrect, and evaluate overall performance.
Choosing the right performance metric matters and varies per problem!
Task Performance
On average, most humans and models are able
to learn almost any task following this method.
In terms of performance comparisons
however, sometimes we:
● Underachieve
● Overachieve
Underachieving
Reasons:
● Unseen Test Data: If the data in the examination is totally
unrelated to the Train Data, then the model will get confused.
Evenly distribute your data between Train and Test Sets.
● Insufficient Training Data: Perhaps the amount of Training
Data is insufficient / too difficult to learn anything useful
from.
Add more data or try new features.
● Model Architecture: The Model selected for a particular
task may not be the right choice for it.
Overachieving
Reasons:
● Randomness: Sometimes it’s just dumb luck. (Models are
initialized with Random Variable Values).
● Model Pretraining: If your Model was trained on a task
similar to this one before and has a good memory, it may
perform well even if your Training Data was pretty small /
useless.
A lot of research is going into pre-training these days!
Model Predictions
In order to trust that our model’s are working correctly, it’s
always a good idea to provide additional explainability with the
model output like:
● Confidence Score(s)
● Input Features
Let’s quickly Train a Model:
https://teachablemachine.withgoogle.com/
Thank you!
Any questions?
Find me: ramsha@gdglahore.com

More Related Content

Machine learning: A Walk Through School Exams

  • 1. Machine Learning and A Walk through School Exams! Introduction to Artificial Intelligence
  • 2. SPEAKER IMAGE Ramsha Siddiqui Associate Data Scientist (NLP) i2c inc. Lahore, Pakistan ● 💬 Conversational AI and Dialog Systems. ● 👩💻 Google Developers Group, Lahore. ● 🥇 WTM and WDA Scholar, 2018-2020. ● 🎓 FAST NUCES, Lahore - Spring, 2019. ● ✈️ Global UGRAD Alumnus - UIW, Texas. ● 💼 Co-Founder of Startup - FunKadaa.
  • 3. What is Machine Learning? Machine Learning is the application of Artificial Intelligence that allows machines to learn and improve from experience, without being explicitly programmed, to solve almost any problem in the world.
  • 4. How do humans learn?
  • 5. The Life of a Student 1. Gather Knowledge
  • 6. The Life of a Student 1. Gather Knowledge 2. Extract Concepts
  • 7. The Life of a Student 2. Extract Concepts 3. Practice Concepts 1. Gather Knowledge
  • 8. The Life of a Student 3. Practice Concepts 4. Test Yourself 1. Gather Knowledge 2. Extract Concepts
  • 9. Learning Chess! 3. Practice 4. Compete! 1. Learn Pieces and Moves 2. Understand & Memorize
  • 10. How do machines learn?
  • 11. 1. Gather Training Data The initial set of data-points required to learn about a problem, in order to solve it.
  • 12. 2. Data Preprocessing Analyzing Data and Extracting or Deriving useful features from it, in efforts to improve results.
  • 13. Why is it important?
  • 14. 3. Model Selection / Construction An algorithm / mathematical derivation containing variables that can be derived / learned from Training Data is called a Machine Learning Model. The values of the variables are saved after training to be used for predictions later.
  • 15. 3. Model Selection / Construction Selecting the right “kind of model” for your Machine Learning is also important, because feature-learning / data-understanding is an internal process for machines, and certain types of problems are more well-suited for certain types of algorithms. Let’s look at the two broadest types!
  • 16. Supervised Learning When a Model’s Expected Outputs are defined, it’s called a Supervised Learning Problem. It mainly has two sub-categories: ● Classification (categorizing input data into classes) ● Regression (predicting a continuous / real value instead of an output class-label)
  • 17. Example: Facial Recognition Recognizing people’s faces and its features (eyes, head-pose, etc.)
  • 18. Example: Facial Recognition Convolutional Neural Networks (CNNs) have been classically useful for the task of identifying different components / features of images.
  • 19. Example: Speech Recognition Converting Audio Sequences (Speech) into Text Sequences.
  • 20. Example: Speech Recognition Sequence to Sequence Networks (Seq2Seq) have so far shown promising results for this task (with updated research and architectures being released almost every day!)
  • 21. Example: Covid Projection Predicting the number of Covid-Cases every other day / month.
  • 22. Example: Covid Projection Time-Series Forecasting is a common problem in Machine Learning, and all models used for that task, can be trained here for comparison.
  • 23. A Note: Some of these problems such as ● Image Classification ● Text Classification, etc. you’ll find that some Model Architectures are also problem- favorable, as they’ve shown good results before. It’s always wise for you to do some Research beforehand to find good Model Implementations / Datasets on the task you’re working on, before starting from scratch.
  • 24. Unsupervised Learning When a Model’s Expected Outputs are undefined, and input-data only needs to be clustered or segmented into somewhat meaningful groups, it’s called Unsupervised Learning. Example: ● K-Means Algorithm (Finds Cluster Centroids based on the no. of centers defined = K)
  • 25. Example: Topic Modeling Training a model to learn the topic of a document based on the correlations of different words used inside it, without knowing prior what those topics are.
  • 26. A Note: Know your Problem Domain!
  • 27. 4. Model Training Feeding your Input Data to your Model for learning - is called Model Training. Here’s some things you may wanna do before that: ● Data Folds: Splitting your Training Data into two sets: One for Training on, and one for Validating Performance. ● Epochs: The number of times your model sees the Training Data (revising it). ● Model Parameters: Take out a set of possible parameter values that you want to tweak in your model.
  • 28. Example: w1*x1 + w2*x2 + w3*x3 = y where for every example, we have input-values “x” and model-variables “w”.
  • 29. 5. Model Testing Alas, models can’t escape examinations either. After Training a Model, we want to see Model Predictions, and compare the values that model got with those it got incorrect, and evaluate overall performance. Choosing the right performance metric matters and varies per problem!
  • 31. On average, most humans and models are able to learn almost any task following this method. In terms of performance comparisons however, sometimes we: ● Underachieve ● Overachieve
  • 32. Underachieving Reasons: ● Unseen Test Data: If the data in the examination is totally unrelated to the Train Data, then the model will get confused. Evenly distribute your data between Train and Test Sets. ● Insufficient Training Data: Perhaps the amount of Training Data is insufficient / too difficult to learn anything useful from. Add more data or try new features. ● Model Architecture: The Model selected for a particular task may not be the right choice for it.
  • 33. Overachieving Reasons: ● Randomness: Sometimes it’s just dumb luck. (Models are initialized with Random Variable Values). ● Model Pretraining: If your Model was trained on a task similar to this one before and has a good memory, it may perform well even if your Training Data was pretty small / useless. A lot of research is going into pre-training these days!
  • 34. Model Predictions In order to trust that our model’s are working correctly, it’s always a good idea to provide additional explainability with the model output like: ● Confidence Score(s) ● Input Features
  • 35. Let’s quickly Train a Model: https://teachablemachine.withgoogle.com/
  • 36. Thank you! Any questions? Find me: ramsha@gdglahore.com