Professional Documents
Culture Documents
Chapter 1
Chapter 1
Chapter 1
A I F U N D A M E N TA L S
Nemanja Radojkovic
Senior Data Scientist
About me
MSc in Signal Processing and Control Systems Design.
AI FUNDAMENTALS
What is all the AI fuss about?
Just top 3 AI-related news on Friday, September 6th 2019:
AI FUNDAMENTALS
AI = Arti cial Intelligence
AI FUNDAMENTALS
The Beginnings
Alan Turing John McCarthy
AI FUNDAMENTALS
AI FUNDAMENTALS
The revolution
AI FUNDAMENTALS
Alpha Go by Google
AI FUNDAMENTALS
Autonomous cars
AI FUNDAMENTALS
Art
AI FUNDAMENTALS
What is Intelligence?
Intelligence is:
... the ability to reason, plan, solve problems, think abstractly, comprehend complex ideas, learn
quickly and learn from experience.
1 Source: http://www1.udel.edu/educ/gottfredson/reprints/1997mainstream.pdf
AI FUNDAMENTALS
What is AI?
General AI (aka "strong AI")
Still only science- ction
One-trick horse
AI FUNDAMENTALS
AI FUNDAMENTALS
Machine Learning + Python = Perfect match
simple and beautiful
exible
dynamically typed and allowing both
object-oriented and functional programming
versatile
used for crunching data, making websites,
programming toys...
AI FUNDAMENTALS
To in nity and
beyond!
A I F U N D A M E N TA L S
All models are wrong
but some are useful
A I F U N D A M E N TA L S
Nemanja Radojkovic
Senior Data Scientist
What is a model?
A simpli ed representation of a process or a system
AI FUNDAMENTALS
How do we build one?
1. De ne the problem
4. Use it!
AI FUNDAMENTALS
De ne the problem
Poor problem de nition = highway to disaster
Key questions
AI FUNDAMENTALS
Con gure the model
1. Specify the technical problem
Example
model = DecisionTreeClassifier()
AI FUNDAMENTALS
Fit the model
Fitting = mathematical optimization
Ingredients
1. Optimization algorithm
2. Cost function
3. Data
model.fit(inputs, outputs)
AI FUNDAMENTALS
Parameters and hyperparameters
1. Model parameters
learned at the tting time, fast, automated
2. Hyperparameters
de ned prior to tting, slow and costly
optimization process
AI FUNDAMENTALS
Reality check
AI FUNDAMENTALS
Performance evaluation
Holdout train/test splitting
Model tting
model.fit(X_train, y_train)
y_predicted = model.predict(X_test)
accuracy = accuracy_score(y_test , y_predicted)
AI FUNDAMENTALS
Let's dive in!
A I F U N D A M E N TA L S
Three avors of
Machine Learning
A I F U N D A M E N TA L S
Nemanja Radojkovic
Senior Data Scientist
Supervised Learning
Most used avor of Machine Learning
Applications
Performance prediction
Risk modeling
AI FUNDAMENTALS
Regression vs. Classi cation
Regression Classi cation
AI FUNDAMENTALS
Supervised algorithms
Regression (quantities) Classi cation (categories)
from sklearn.ensemble \
import RandomForestClassifier
AI FUNDAMENTALS
Unsupervised Learning
Unlabeled data.
AI FUNDAMENTALS
Unsupervised learning: Clustering
AI FUNDAMENTALS
Unsupervised learning: Anomaly detection
AI FUNDAMENTALS
Unsupervised learning: Dimensionality reduction
AI FUNDAMENTALS
Unsupervised algorithms
Clustering Dimensionality reduction
# DBSCAN
Anomaly detection
from sklearn.cluster import DBSCAN
# Isolation forests
from sklearn.ensemble \
import IsolationForest
AI FUNDAMENTALS
Reinforcement learning
"Learning by doing"
AI FUNDAMENTALS
Recap time!
A I F U N D A M E N TA L S