SlideShare a Scribd company logo
1 of 33
Download to read offline
Machine learning
Applications, types and key concepts
● What is machine learning?
● Applications
● Types
● Terminology
● Key concepts
Outline
Next classes
1. Key concepts
2. A tour of machine learning (linear algebra, probability theory, calculus)
3. Machine learning pipelines (pre-processing, model training, and evaluation in Python and Scala)
4. Machine learning case studies (Python and Scala examples)
a. Sentiment analysis (Natural Language Processing, NLTK)
b. Spam classifier
c. Stock price prediction (regression)
d. Image recognition, deep learning (TensorFlow, keras)
e. Recommendation engine
5. Machine learning at scale (algorithms, linear algebra, probability, Spark MLLib, Vowpal Wabbit, scikit-learn)
Next classes
Key concepts Tour Pipelines Case studies Scale
Concepts ০০০ ০ ০০ ০০ ০০০
Code ০ ০০ ০০০ ০০০ ০০০
Math/stats ০ ০০০ ০ ০ ০০০
What is machine learning?
● Learn from data (past experiences)
● Generalize (find the signal/pattern)
● Predict, forward looking
● Observational data
Relationship to data science and deep learning
What is machine learning?
Data Science
ML
DL
Applications
● Autonomous cars
● Siri
● Facial recognition
● People who bought this also bought...
● Spam filters
● Targeted advertising
● ...
Types of machine learning
● Supervised learning
○ Classification
○ Regression
● Unsupervised learning
● Reinforcement learning
Types of machine learning
Supervised Unsupervised Reinforcement learning
Cancer diagnosis
Stock market prediction
Customer churn
Recommendation engine
Anomaly detection
Dimensionality reduction
Clustering
PageRank
Anomaly detection
Self-driving cars
AlphaGo
(Linear) Regression
● Predict a continuous variable (e.g. price)
● Y=mx+b
● Ordinary Least Squares
● Analytical solution
● Geometric model
(Linear) Regression
● Can use multiple variables
(multi-variate regression)
● Relationships are not always linear
(Linear) Regression example
● Boston housing dataset
● Median value of houses (MV)
vs. average # rooms (RM)
from sklearn.linear_model import LinearRegression
model = LinearRegression()
x, y = housing[['RM']], housing['MV']
model.fit(x, y)
model.score(x, y)
R2=0.48
(Linear) Regression example
● Boston housing dataset
● Median value of houses (MV)
vs. average # rooms (RM),
and industrial zoning proportions (INDUS)
from sklearn.linear_model import LinearRegression
model = LinearRegression()
x, y = housing[['RM', ‘INDUS’]], housing['MV']
model.fit(x, y)
model.score(x, y)
R2=0.53
(Linear) Regression example
● Intuition breaks down in high-dimensions (>3)
● Interpretability goes down
● Real-world data is usually non-linear
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Terminology
● Feature (a.k.a. input, variable, predictor, explanatory, independent variable)
● Output (a.k.a. target, label, class, dependent variable)
● Training instance (aka observation, row)
● Training dataset
● Training (a.k.a. learning, modeling, fitting)
● Model validation and testing
RM INDUS ZN ... MV
6.575 2.31 18.0 ... 24.0
6.421 7.07 0.0 ... 21.6
... ... ... ... ...
Statistical learning
● The true underlying function is not known
● Usually can’t observe all features (e.g. policy impact, global trends, etc.)
● Most interesting phenomenon are neither deterministic, nor stationary
● No guarantee that a set of variables is predictive of the outcome
Machine learning territory100% deterministic
F=ma
100% stochastic
Coin flip
Classification
● Target variable, qualitative, classes
● Binary classification
Cancer patient
Positive class (class of interest)
Healthy patient
Negative class
Classification
● Linear vs. non-linear decision boundaries
● Model complexity, training time, and latency
Bias
Cancer patient
Positive class (class of interest)
Healthy patient
Negative class
Bias
Cancer patient
Positive class (class of interest)
Healthy patient
Negative class
Bias
Variance/overfit
● Learning the wrong things, memorizing
● Modeling the noise and not the signal
○ Model 1- if GPA > 3.8 and hours studied>5 then passed
○ Model 2- if student ID != 2 then passed
○ New record: StudentID = 4, Hours Studied = 5.5, GPA = 3.82, passed?
Student ID Hours studied GPA ... Passed
1 10 4.00 Yes
2 0 2.71 No
3 6 3.95 Yes
Bias/variance
Guarding against overfitting
● Split into train, validation and test
● Cross-validation
Summary
Increasing model complexity generally:
● Increases model fit
● Decreases interpretability
● Increases chance of overfitting
● Increases training time
● Increases model latency
Remember that...
Next class: a tour of machine learning
Preparation for next class
1- Test your understanding: http://bit.ly/mlseries1
2- Check this out: Visual intro to ML
Want to pursue machine learning more seriously?
● Read A few useful things to know about machine learning
● Theory and intuition, Python Machine Learning book
● Hands-on experience, Kaggle (start with titanic)
● Elements of statistical learning (advanced)

More Related Content

Viewers also liked

Regenerating America's Legacy Cities
Regenerating America's Legacy CitiesRegenerating America's Legacy Cities
Regenerating America's Legacy CitiesCassidy Swanson
 
Big Data - To Explain or To Predict? Talk at U Toronto's Rotman School of Ma...
Big Data - To Explain or To Predict?  Talk at U Toronto's Rotman School of Ma...Big Data - To Explain or To Predict?  Talk at U Toronto's Rotman School of Ma...
Big Data - To Explain or To Predict? Talk at U Toronto's Rotman School of Ma...Galit Shmueli
 
Predictive Modeling Workshop
Predictive Modeling WorkshopPredictive Modeling Workshop
Predictive Modeling Workshopodsc
 
Max Kuhn's talk on R machine learning
Max Kuhn's talk on R machine learningMax Kuhn's talk on R machine learning
Max Kuhn's talk on R machine learningVivian S. Zhang
 

Viewers also liked (6)

Regenerating America's Legacy Cities
Regenerating America's Legacy CitiesRegenerating America's Legacy Cities
Regenerating America's Legacy Cities
 
Big Data - To Explain or To Predict? Talk at U Toronto's Rotman School of Ma...
Big Data - To Explain or To Predict?  Talk at U Toronto's Rotman School of Ma...Big Data - To Explain or To Predict?  Talk at U Toronto's Rotman School of Ma...
Big Data - To Explain or To Predict? Talk at U Toronto's Rotman School of Ma...
 
Basic ML
Basic MLBasic ML
Basic ML
 
IFI7159 M2
IFI7159 M2IFI7159 M2
IFI7159 M2
 
Predictive Modeling Workshop
Predictive Modeling WorkshopPredictive Modeling Workshop
Predictive Modeling Workshop
 
Max Kuhn's talk on R machine learning
Max Kuhn's talk on R machine learningMax Kuhn's talk on R machine learning
Max Kuhn's talk on R machine learning
 

Similar to Machine learning- key concepts

Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector MachinesCloudxLab
 
Machine learning and linear regression programming
Machine learning and linear regression programmingMachine learning and linear regression programming
Machine learning and linear regression programmingSoumya Mukherjee
 
Week_1 Machine Learning introduction.pptx
Week_1 Machine Learning introduction.pptxWeek_1 Machine Learning introduction.pptx
Week_1 Machine Learning introduction.pptxmuhammadsamroz
 
Recommender Systems from A to Z – Model Training
Recommender Systems from A to Z – Model TrainingRecommender Systems from A to Z – Model Training
Recommender Systems from A to Z – Model TrainingCrossing Minds
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksMachine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksKevin Lee
 
Intro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft VenturesIntro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft Venturesmicrosoftventures
 
Gradient Boosted Regression Trees in scikit-learn
Gradient Boosted Regression Trees in scikit-learnGradient Boosted Regression Trees in scikit-learn
Gradient Boosted Regression Trees in scikit-learnDataRobot
 
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 Dori Waldman
 
Machine learning4dummies
Machine learning4dummiesMachine learning4dummies
Machine learning4dummiesMichael Winer
 
MLEARN 210 B Autumn 2018: Lecture 1
MLEARN 210 B Autumn 2018: Lecture 1MLEARN 210 B Autumn 2018: Lecture 1
MLEARN 210 B Autumn 2018: Lecture 1heinestien
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsMark Peng
 
An introduction to variable and feature selection
An introduction to variable and feature selectionAn introduction to variable and feature selection
An introduction to variable and feature selectionMarco Meoni
 
Machine learning Investigative Reporting NorthBaySolutions.pdf
Machine learning Investigative Reporting NorthBaySolutions.pdfMachine learning Investigative Reporting NorthBaySolutions.pdf
Machine learning Investigative Reporting NorthBaySolutions.pdfssusera5352a2
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models ananth
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statisticsSpotle.ai
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learningYogendra Singh
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptxssuserf07225
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlpankit_ppt
 

Similar to Machine learning- key concepts (20)

Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machines
 
Machine learning and linear regression programming
Machine learning and linear regression programmingMachine learning and linear regression programming
Machine learning and linear regression programming
 
Week_1 Machine Learning introduction.pptx
Week_1 Machine Learning introduction.pptxWeek_1 Machine Learning introduction.pptx
Week_1 Machine Learning introduction.pptx
 
Recommender Systems from A to Z – Model Training
Recommender Systems from A to Z – Model TrainingRecommender Systems from A to Z – Model Training
Recommender Systems from A to Z – Model Training
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksMachine Learning : why we should know and how it works
Machine Learning : why we should know and how it works
 
Intro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft VenturesIntro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft Ventures
 
Gradient Boosted Regression Trees in scikit-learn
Gradient Boosted Regression Trees in scikit-learnGradient Boosted Regression Trees in scikit-learn
Gradient Boosted Regression Trees in scikit-learn
 
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
 
MLEARN 210 B Autumn 2018: Lecture 1
MLEARN 210 B Autumn 2018: Lecture 1MLEARN 210 B Autumn 2018: Lecture 1
MLEARN 210 B Autumn 2018: Lecture 1
 
General Tips for participating Kaggle Competitions
General Tips for participating Kaggle CompetitionsGeneral Tips for participating Kaggle Competitions
General Tips for participating Kaggle Competitions
 
An introduction to variable and feature selection
An introduction to variable and feature selectionAn introduction to variable and feature selection
An introduction to variable and feature selection
 
Scalable machine learning
Scalable machine learningScalable machine learning
Scalable machine learning
 
Machine learning Investigative Reporting NorthBaySolutions.pdf
Machine learning Investigative Reporting NorthBaySolutions.pdfMachine learning Investigative Reporting NorthBaySolutions.pdf
Machine learning Investigative Reporting NorthBaySolutions.pdf
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statistics
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learning
 
Week 1.pdf
Week 1.pdfWeek 1.pdf
Week 1.pdf
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptx
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 

Machine learning- key concepts

  • 2. ● What is machine learning? ● Applications ● Types ● Terminology ● Key concepts Outline
  • 3. Next classes 1. Key concepts 2. A tour of machine learning (linear algebra, probability theory, calculus) 3. Machine learning pipelines (pre-processing, model training, and evaluation in Python and Scala) 4. Machine learning case studies (Python and Scala examples) a. Sentiment analysis (Natural Language Processing, NLTK) b. Spam classifier c. Stock price prediction (regression) d. Image recognition, deep learning (TensorFlow, keras) e. Recommendation engine 5. Machine learning at scale (algorithms, linear algebra, probability, Spark MLLib, Vowpal Wabbit, scikit-learn)
  • 4. Next classes Key concepts Tour Pipelines Case studies Scale Concepts ০০০ ০ ০০ ০০ ০০০ Code ০ ০০ ০০০ ০০০ ০০০ Math/stats ০ ০০০ ০ ০ ০০০
  • 5. What is machine learning? ● Learn from data (past experiences) ● Generalize (find the signal/pattern) ● Predict, forward looking ● Observational data
  • 6. Relationship to data science and deep learning What is machine learning? Data Science ML DL
  • 7. Applications ● Autonomous cars ● Siri ● Facial recognition ● People who bought this also bought... ● Spam filters ● Targeted advertising ● ...
  • 8. Types of machine learning ● Supervised learning ○ Classification ○ Regression ● Unsupervised learning ● Reinforcement learning
  • 9. Types of machine learning Supervised Unsupervised Reinforcement learning Cancer diagnosis Stock market prediction Customer churn Recommendation engine Anomaly detection Dimensionality reduction Clustering PageRank Anomaly detection Self-driving cars AlphaGo
  • 10. (Linear) Regression ● Predict a continuous variable (e.g. price) ● Y=mx+b ● Ordinary Least Squares ● Analytical solution ● Geometric model
  • 11. (Linear) Regression ● Can use multiple variables (multi-variate regression) ● Relationships are not always linear
  • 12. (Linear) Regression example ● Boston housing dataset ● Median value of houses (MV) vs. average # rooms (RM) from sklearn.linear_model import LinearRegression model = LinearRegression() x, y = housing[['RM']], housing['MV'] model.fit(x, y) model.score(x, y) R2=0.48
  • 13. (Linear) Regression example ● Boston housing dataset ● Median value of houses (MV) vs. average # rooms (RM), and industrial zoning proportions (INDUS) from sklearn.linear_model import LinearRegression model = LinearRegression() x, y = housing[['RM', ‘INDUS’]], housing['MV'] model.fit(x, y) model.score(x, y) R2=0.53
  • 14. (Linear) Regression example ● Intuition breaks down in high-dimensions (>3) ● Interpretability goes down ● Real-world data is usually non-linear
  • 15. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 16. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 17. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 18. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 19. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 20. Terminology ● Feature (a.k.a. input, variable, predictor, explanatory, independent variable) ● Output (a.k.a. target, label, class, dependent variable) ● Training instance (aka observation, row) ● Training dataset ● Training (a.k.a. learning, modeling, fitting) ● Model validation and testing RM INDUS ZN ... MV 6.575 2.31 18.0 ... 24.0 6.421 7.07 0.0 ... 21.6 ... ... ... ... ...
  • 21. Statistical learning ● The true underlying function is not known ● Usually can’t observe all features (e.g. policy impact, global trends, etc.) ● Most interesting phenomenon are neither deterministic, nor stationary ● No guarantee that a set of variables is predictive of the outcome Machine learning territory100% deterministic F=ma 100% stochastic Coin flip
  • 22. Classification ● Target variable, qualitative, classes ● Binary classification Cancer patient Positive class (class of interest) Healthy patient Negative class
  • 23. Classification ● Linear vs. non-linear decision boundaries ● Model complexity, training time, and latency
  • 24. Bias Cancer patient Positive class (class of interest) Healthy patient Negative class
  • 25. Bias Cancer patient Positive class (class of interest) Healthy patient Negative class
  • 26. Bias
  • 27. Variance/overfit ● Learning the wrong things, memorizing ● Modeling the noise and not the signal ○ Model 1- if GPA > 3.8 and hours studied>5 then passed ○ Model 2- if student ID != 2 then passed ○ New record: StudentID = 4, Hours Studied = 5.5, GPA = 3.82, passed? Student ID Hours studied GPA ... Passed 1 10 4.00 Yes 2 0 2.71 No 3 6 3.95 Yes
  • 29. Guarding against overfitting ● Split into train, validation and test ● Cross-validation
  • 30. Summary Increasing model complexity generally: ● Increases model fit ● Decreases interpretability ● Increases chance of overfitting ● Increases training time ● Increases model latency
  • 32. Next class: a tour of machine learning
  • 33. Preparation for next class 1- Test your understanding: http://bit.ly/mlseries1 2- Check this out: Visual intro to ML Want to pursue machine learning more seriously? ● Read A few useful things to know about machine learning ● Theory and intuition, Python Machine Learning book ● Hands-on experience, Kaggle (start with titanic) ● Elements of statistical learning (advanced)