SlideShare une entreprise Scribd logo
1  sur  175
How to
implement
Artificial
Intelligence
solutions
ByCarlosToxtli
First things first
Introduction
Let’s get started
There’ll be Maths ...
You during the talk ...
You after the talk ...
Index
● Overview
● Discriminative techniques
● Machine Learning
● Deep Learning
● Reinforcement Learning
● Generative techniques
● Conclusions
Overview
Basic concepts
AI technologies
Machine
Learning
Areas
What is Artificial Intelligence?
Artificial intelligence (Artificial Intelligence, or AI) is the simulation of human
intelligence processes by machines, especially computer systems. These
processes include learning (the acquisition of information and rules for the
use of information), reasoning (using the rules to reach approximate or
definitive conclusions) and self-correction.
Predictions of the Mexican elections
World Cup Predictions
They are not usually very accurate since there
are many factors at play.
It is able to understand us
Although we give
very basic concepts,
AI can create more
complex concepts.
Create videos controlling a person
It has been possible to
create videos
supplanting someone's
identity.
Songs composed by AI
Song that is
composed from
the sound (hum) of
the human voice.
1958
The computer will be the first device to
think as the human brain. It can
understand its surroundings,
recognize you speak your name and
translate in real time.
It is possible to build brains that
could reproduce themselves on an
assembly and which would be
conscious of their existence.
Rosenblatt murio en un accidente
Geoffrey Hinton is the father of neural networks
Fun fact about George Boole
Geoffrey Hinton is a great-great-great-great
grandson of George Boole.
He changed the world from the mechanical
industrial era to the digital era.
AI is also in the interest of governments
Geoffrey Hinton
currently resides in
Canada and the
government is
investing in being a
reference in the AI
scene.
Getting started in Artificial
Intelligence
How do I start?
The first thing you should know is that you start either as an implementer of
existing techniques or as a creator of new techniques.
Creator of new techniques (Scientist)
In order to propose new algorithms, deep knowledge is required in several
areas, including:
● Linear algebra
● Statistics
● Equation systems
● Calculus
● Parallel computing
● Data structures
● Programming languages (usually C or Python)
… Among other areas
As an implementer you just need to know how each technique differs from
another and know which one to use depending on the problem. The process
of implementing only implies adapting the inputs to which each algorithm
requires, without the need to program a new algorithm. This requires:
● Data processing
● Programming languages (usually C or Python)
● Parallel computing
Among others
Implementer of existing techniques (Engineering)
This talk will focus on how to implement
While it is true that the great discoveries come from the generation of new
algorithms, reaching a sufficient level of understanding of the foundations of
artificial intelligence takes time and usually requires postgraduate studies.
As an implementer you will eventually be able to improve existing
techniques.
The evolution of the methods
A simple way to understand how to implement AI is compared to a
conventional programming method. A method is a piece of code that runs
and returns a result, example:
house_price = get_price( house_location )
The result can be searched in a database or calculated based on an existing
formula (existing rules).
The evolution of the methods
When we implement an AI technique, it is implemented in a manner similar
to a method, but there is no defined formula to obtain the result, and it
returns 2 values, a predicted value and the percentage of certainty.
precio_casa, certainty_percentage = predict_price( house_location )
The result is inferred based on previous data. There is no exact formula, it is
always estimated based on similar data.
To start a classic example is the Hot Dog and No Hot Dog. For that hundreds
of Hot Dogs photos and hundreds of photos of anything else are collected.
With that many of the techniques detect precisely if there is a Hot Dog. This is
what the function would look like
detected_class, certainty_percentage = is_a_hot_dog( image )
Where the detected_class is “Hot Dog”
And certainty_percentage ranges from 0 to 1
If the value is higher to a threshold (i.e. 0.5)
then It is a Hot Dog
The most basic example: Hot dog / Not Hot Dog
It is complicated
even for humans
Hot dog / Not Hot Dog use case
As in the SIlicon
Valley series
Detecting cats and dogs
In this case we need 3 data sets, hundreds of photos of dogs,
hundreds of cats and hundreds of anything else.
detected_classes, certainty_percentages = cat_or_dog( images )
Because they are more than one category, the function returns
a data array, where:
detected_classes[0] is “dog” y certainty_percentages[0] is 0.2
detected_classes[1] is “cat” y certainty_percentages[1] is 0.7
detected_classes[2] is “other” y certainty_percentages[2] is 0.1
Then it is more likely to be a cat.
Self-driving cars use the same principles
A car that drives itself, even if it sounds very complex, is just the
implementation of several AI functions, this is a very simple example:
detected_classes, certainty_percentages = vision_sensor_1( camera_image )
IF detected_classes[0] == ‘Another car’ and certainty_percentages[0] < .1
AND detected_classes[1] == ‘Pedestrian’ and certainty_percentages[1] < .1
Then SWITCH_LINE()
Autonomous car engineers use models
Dedicated to making autonomous cars is something very attainable for
anyone, since the vast majority of tests are done on models and not on real
cars. Once it is 100% efficient in models, tests are carried out on cars. An
autonomous car laboratory can be set up at a very low cost.
Classification and Regression
We have already learned these concepts
with examples of Supervised Learning
Regression predicts a value, as in the
case of the house, a house closer to a
shopping center and main roads, returns
a value in larger price, example 1,000,000
Classification predicts a category, in
the examples the "classes" or categories
to search are returned and based on that
it returns us if it is "dog" or "cat". We
know in advance the categories.
But there is an extra case (Clustering)
When we don't know the categories of the data (Unsupervised
Learning) we need the computer to group those that resemble
each other, then give them a name:
class_found, certainty_percentage = find_category( data[0] )
class_found, certainty_percentage = find_category( data[1] )
class_found, certainty_percentage = find_category( data[2] )
This case is called Clustering. An example may be to give pictures
of drawn letters, the result should be to group them into
separate letters.
Now you know the basics
With what has been learned, it is enough to raise a problem and solve it using
different types of learning, now we will see what techniques exist and when
each one is used.
Now it’s time to learn how to implement it
Machine Learning requires proper data
Machine Learning is the general concept of how a computer can learn.
Learning comes from receiving new information and adapting its parameters
to correctly identify new cases. This requires a lot of information, but you
also need to know what parameters ("features") to analyze.
Features?
Yes, we need to find based on
what parameters to
differentiate from one
another, for example there are
very similar species of fish.
In what characteristics would
you identify to identify them.
Color, size, number of fins?
The next step is to “annotate” (labeling)
Since we have each record of each specimen now manually we must specify
what "class" is, for example:
And then when unseen data are presented, we can predict.
Color Size Fins CLASS
Golden 20 5 Tilapia
Silver 10 6 Tuna
Silver 30 6 Salmon
Color Size Fins CLASS
Silver 20 6 ???
With the Classes and Features we can start
Ready now if we can feed any algorithm to get a result.
The most used are:
● kNN
● Bayes
● Support Vector Machines
● Neural Networks
● Decision Trees
● Random Forest
● ...
Among many others
Now we have to train the model
Once we have the Classes, the
Features and choose an algorithm. We
proceed to train it, the outcome is a
file called Model with the rules to
classify data not seen before.
But without good features, it won't be accurate
Example:
To predict
The features are not enough, we need to gather more data or features that
are more discriminative.
Color Size Fins CLASS
Golden 20 5 Tilapia
Silver 10 6 Tuna
Silver 30 6 Salmon
Color Size Fins CLASS
Silver 20 6 ???
Preparing the proper data is vital
Let's get our hands dirty
IRIS dataset
IRIS Dataset
. . .
Box plots
Data
distribution
Frameworks
● Sklearn
● Weka
● Matlab
Linear Regression
Linear Regression
Code
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = LinearRegression()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
Linear regression
When to use it?
● Simple regression problems
○ How much the rent should cost in certain area
○ How much should I charge for specific amount of work
● Problems where we want to define a rule that separates two
categories that are similar, i.e. Premium or Basic price for customers
under certain parameters (number of rooms vs number of cars)
XOR problem - Not linear
Decision Tree
Code
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier, export_graphviz
import pydotplus
iris = load_iris()
clf = DecisionTreeClassifier().fit(iris.data, iris.target)
dot_data = export_graphviz(clf, out_file=None, filled=True, rounded=True,
feature_names=iris.feature_names,
class_names=['Versicolor','Setosa','Virginica'])
graph = pydotplus.graph_from_dot_data(dot_data)
Decisions
map
When to use it?
● When we need to know what decisions the machine is taking
● When we need to explain to others how the features are evaluated
● When there are no much features
Random Forest
Code
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = RandomForestClassifier(n_estimators=100)
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● When we want to know alternatives of how to evaluate a problem.
● When we want to manually discard flows that are biased
● When we want to manage ensembles from one single method.
Naive Bayes
Naive Bayes
Naive Bayes
Code
from sklearn.naive_bayes import GaussianNB
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = GaussianNB()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● When we want to know the probabilities of the different cases.
● When we need a probabilistic model.
● When we need an easy way to prove in paper.
k-Nearest Neighbor
k-Nearest Neighbor
k-Nearest Neighbor
k-Nearest Neighbor
k-Nearest Neighbor
Code
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.neighbors import NearestNeighbors
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = NearestNeighbors(n_neighbors=5)
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● When intuition says that the problem can be solved from getting thee
most similar option.
● When the information is no exhaustive.
● When we want to justify the decision of the algorithm in a common
human reasoning.
k-Means
k-Means
Code
from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale
digits = load_digits()
data = scale(digits.data)
reduced_data = PCA(n_components=2).fit_transform(data)
print(reduced_data)
kmeans = KMeans(init='k-means++', n_clusters=10, n_init=10)
kmeans.fit(reduced_data)
kmeans.predict(reduced_data[:10])
When to use it?
● When we don’t know how to understand the data
● When we want to optimize resources by grouping related elements.
● When we want that the computer creates the labels for us.
Support Vector Machine
Support Vector Machine
Code
from sklearn.datasets import load_iris
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
classifier = SVC()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● It was the most effective technique before Neural Networks, it can
achieve excellent results with less processing.
● Mathematically speaking, it is based in very strong math principles, it
creates complex multidimensional hyperplanes that separates the classes
precisely.
● It is not a white box technique, but may be the best option for problems
where we want to get the best of Machine Learning approach without
dealing with Neural Networks.
Logistic Regression
No regularization
L2 regularization
Code
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.neighbors import NearestNeighbors
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = LogisticRegression(multi_class='multinomial')
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● When we want to optimize a regression
● When we want to binarize the output
● As a preliminary analysis before implementing neural networks
Perceptron
Code
from sklearn.linear_model import Perceptron
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.neighbors import NearestNeighbors
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2)
clf = Perceptron()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print('accuracy is',accuracy_score(y_pred, y_test))
When to use it?
● When we have very few features and there is no extra details that can be
extracted from hidden layers.
● There are in fact neural networks, and we do not need alway to use
them for deep learning these can be used for machine learning when we
benchmark with other machine learning techniques.
● When we want to get the power of neural networks and we don’t have
much computational power.
That was machine learning
ML & DL frameworks
It’s time for Deep Learning
Deep Learning
Deep Learning
Deep Learning
Artificial Neural Networks = Multi-Layer Perceptron
ANN - Neuron
ANN - Layers
ANN - Components
ANN - Flow
ANN - Gradients
ANN - Gradients
ANN - Optimizers
ANN - Decision boundary
ANN - Decision boundary
ANN - Performance metrics
ANN - Overfitting
ANN -
Regularization
Frameworks
● Tensorflow
● Keras
● Pythorch
● Sklearn
When to use it?
● Classifiers when common machine Learning Algorithms performs
poorly.
● Models with much features.
● Multiple classes projects.
Convolutional Neural Networks (CNN)
MNIST
All that knowledge to train a CNN to do this ...
Frameworks
● Tensorflow
● Keras
● Pytorch
● Caffe
When to use it?
● When we want to process images
● When we want to process videos
● When we have highly dimensional data.
Recurrent Neural Networks (RNN)
RNN
These have memory that keeps
the context.
Frameworks
● Tensorflow
● Keras
● Pytorch
When to use it?
● When sequences are provided
○ Text sequences
○ Image sequences (videos)
○ Time series
● When we need to provide an ordered output
That’s all for Deep Learning techniques
Mixed approaches
Ensembles
Mixed Deep learning features
When to use it?
● When we want to benchmark models
● When different models are stronger when these are evaluated together
● When the individual processing is not exhaustive
AutoML
Frameworks
● TPOT
● MLBox
● H2O
● Google AutoML
When to use it?
● On every new model
● When we have enough time to train multiple models
● When we don’t know wich hyperparameters are better.
Last but not least - Reinforcement Learning
Reinforcement Learning
Reinforcement Learning
Frameworks
● OpenAI Gym
● Google Dopamine
● RLLib
● Keras-RL
● Tensorforce
● Facebook Horizon
When to use it?
● When a robot explores a place and needs to learn from the environment.
● When we can try as much as we can in a simulator.
● When we want to find the most optimal path
Techniques to improve the learning process
Principal Component Analysis (PCA)
Feature selection
When to use it?
● When we have too much features and we do not know which of them
are useful.
● When we want to reduce the dimensionality of our model.
● When we want to plot our decision boundaries.
Data Augmentation
When to use it?
● When we have limited data
● When we want to help our model to generalize more
● When our unseen data comes in very different formats.
That was too much information!
Generative approaches
Follows the data distribution
Discriminative: Predicts from Data
Generative: Generates from data distribution
Examples of Generative Artificial
The following images intermix the
styles of two domains
Generative models
● Autoencoders
● Adversarial Networks
● Sequence Models
● Transformers
Frameworks
● Tensorflow
● Keras
● Pytorch
Autoencoders
Autoencoders - Latent space
Style transfer
When to use it?
● When we want to compress data.
● When we need to change one type of input to other type of output.
● When we don’t need much variability in the generated data.
Generative Adversarial Networks
When to use it?
● When we need to transfer a style
● When we need more variability in the generated output
● When we need to keep context in the generation.
Sequence models
When to use it?
● When we generate text
● When we generate the next sequence from a serie
● When the order in the generated output matters.
When to use it?
● When context is an essential part of the generated output
● When we need to keep consistency in the frequency space.
● When we have enough computational resources.
Summary
● Predict values from numeric features (Regression)
○ Linear regression
○ Polynomial regressions
○ Any machine learning technique without an activation function
● Predict categories from labeled numeric data (Classification)
○ Logistic Regression
○ k-Nearest Neighbors
○ Decision Tree
○ Random Forest
○ Support Vector Machine
○ Perceptron
○ Multi Layer Perceptron
○ Naive Bayes
Summary
● Find labels from unlabeled data (Clustering)
○ K-means
○ LDA
○ NMF
● Detect objects in an image (Classification)
○ Convolutional Neural Networks
● Detect the category of a text or video (Classification)
○ Recurrent Neural Networks
● Learn to navigate and find optimal paths (Try and error)
○ Reinforcement Learning
● Generate images
○ Autoencoders
○ Generative Adversarial Networks
Summary
● Generate audio and text
○ Sequence models
○ Transformers
● Explainable approaches
○ k-Nearest Neighbors
○ Naive Bayes
○ Decision Trees
○ Linear regression
○ K-means
Resources
● Working examples ready to run online (Jupyter)
○ http://bit.ly/awesome-machine-learning
● Communities around the world
○ http://theschool.ai
Conclusions
● Depending on the application that we want to develop we need different
techniques and frameworks
● The model training is the 20% of the work, processing the data to have
something useful is the remaining 80%.
● We need a lot of data to train a model, if you don’t have enough data,
there are always augmentation from transformations and generations
techniques to create more synthetic data form the existing.
● We don’t need to be a data scientist to implement Artificial Intelligence
solutions, we only need to know how the techniques work and how to
tune up.
● Now that you know everything you need, it's time to put it into practice.
Thanks
@ctoxtli
http://www.carlostoxtli.com
http://facebook.com/carlos.toxtli

Contenu connexe

Tendances

Artificial intelligence in practice- part-1
Artificial intelligence in practice- part-1Artificial intelligence in practice- part-1
Artificial intelligence in practice- part-1
GMR Group
 
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete DeckAI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
SlideTeam
 
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
SlideTeam
 

Tendances (20)

Deep learning introduction
Deep learning introductionDeep learning introduction
Deep learning introduction
 
Machine learning vs deep learning
Machine learning vs deep learningMachine learning vs deep learning
Machine learning vs deep learning
 
Demystifying Ml, DL and AI
Demystifying Ml, DL and AIDemystifying Ml, DL and AI
Demystifying Ml, DL and AI
 
Machine Learning and its Applications
Machine Learning and its ApplicationsMachine Learning and its Applications
Machine Learning and its Applications
 
Basics of machine_learning
Basics of machine_learningBasics of machine_learning
Basics of machine_learning
 
Artificial intelligence in practice- part-1
Artificial intelligence in practice- part-1Artificial intelligence in practice- part-1
Artificial intelligence in practice- part-1
 
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete DeckAI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
AI Vs ML Vs DL PowerPoint Presentation Slide Templates Complete Deck
 
Ajit Jaokar, Data Science for IoT professor at Oxford University “Enterprise ...
Ajit Jaokar, Data Science for IoT professor at Oxford University “Enterprise ...Ajit Jaokar, Data Science for IoT professor at Oxford University “Enterprise ...
Ajit Jaokar, Data Science for IoT professor at Oxford University “Enterprise ...
 
What is Deep Learning?
What is Deep Learning?What is Deep Learning?
What is Deep Learning?
 
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
Artificial Intelligence And Machine Learning PowerPoint Presentation Slides C...
 
Introduction to artificial intelligence
Introduction to artificial intelligenceIntroduction to artificial intelligence
Introduction to artificial intelligence
 
Lessons learned from building practical deep learning systems
Lessons learned from building practical deep learning systemsLessons learned from building practical deep learning systems
Lessons learned from building practical deep learning systems
 
Diff between AI& ML&DL
Diff between AI& ML&DLDiff between AI& ML&DL
Diff between AI& ML&DL
 
DWX 2018 Session about Artificial Intelligence, Machine and Deep Learning
DWX 2018 Session about Artificial Intelligence, Machine and Deep LearningDWX 2018 Session about Artificial Intelligence, Machine and Deep Learning
DWX 2018 Session about Artificial Intelligence, Machine and Deep Learning
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Deep Learning - The Past, Present and Future of Artificial Intelligence
Deep Learning - The Past, Present and Future of Artificial IntelligenceDeep Learning - The Past, Present and Future of Artificial Intelligence
Deep Learning - The Past, Present and Future of Artificial Intelligence
 
Ai artificial intelligence professional vocabulary collection - NuAIg
Ai artificial intelligence professional vocabulary collection - NuAIgAi artificial intelligence professional vocabulary collection - NuAIg
Ai artificial intelligence professional vocabulary collection - NuAIg
 
Artificial Intelligence (AI) Interview Questions and Answers | Edureka
Artificial Intelligence (AI) Interview Questions and Answers | EdurekaArtificial Intelligence (AI) Interview Questions and Answers | Edureka
Artificial Intelligence (AI) Interview Questions and Answers | Edureka
 
Benefits from Deep Learning AI for the Mobile Apps
Benefits from Deep Learning AI for the Mobile AppsBenefits from Deep Learning AI for the Mobile Apps
Benefits from Deep Learning AI for the Mobile Apps
 
Artificial Intelligence with Python | Edureka
Artificial Intelligence with Python | EdurekaArtificial Intelligence with Python | Edureka
Artificial Intelligence with Python | Edureka
 

Similaire à How to implement artificial intelligence solutions

Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
Hchethankumar
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
Hchethankumar
 
Meetup 29042015
Meetup 29042015Meetup 29042015
Meetup 29042015
lbishal
 
notes as .ppt
notes as .pptnotes as .ppt
notes as .ppt
butest
 

Similaire à How to implement artificial intelligence solutions (20)

Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
 
introduction to machine learning
introduction to machine learningintroduction to machine learning
introduction to machine learning
 
Machine learning-in-details-with-out-python-code
Machine learning-in-details-with-out-python-codeMachine learning-in-details-with-out-python-code
Machine learning-in-details-with-out-python-code
 
Machine Learning by Rj
Machine Learning by RjMachine Learning by Rj
Machine Learning by Rj
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
 
Internship - Python - AI ML.pptx
Internship - Python - AI ML.pptxInternship - Python - AI ML.pptx
Internship - Python - AI ML.pptx
 
Getting started with Machine Learning
Getting started with Machine LearningGetting started with Machine Learning
Getting started with Machine Learning
 
Machine Learning Contents.pptx
Machine Learning Contents.pptxMachine Learning Contents.pptx
Machine Learning Contents.pptx
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
MachinaFiesta: A Vision into Machine Learning 🚀
MachinaFiesta: A Vision into Machine Learning 🚀MachinaFiesta: A Vision into Machine Learning 🚀
MachinaFiesta: A Vision into Machine Learning 🚀
 
ML crash course
ML crash courseML crash course
ML crash course
 
Meetup 29042015
Meetup 29042015Meetup 29042015
Meetup 29042015
 
ML Lec 1 (1).pptx
ML Lec 1 (1).pptxML Lec 1 (1).pptx
ML Lec 1 (1).pptx
 
Machine Learning Ch 1.ppt
Machine Learning Ch 1.pptMachine Learning Ch 1.ppt
Machine Learning Ch 1.ppt
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
 
Data analytics with python introductory
Data analytics with python introductoryData analytics with python introductory
Data analytics with python introductory
 
Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflow
 
notes as .ppt
notes as .pptnotes as .ppt
notes as .ppt
 
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
IRJET- Unabridged Review of Supervised Machine Learning Regression and Classi...
 

Plus de Carlos Toxtli

Plus de Carlos Toxtli (20)

Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Autom editor video blooper recognition and localization for automatic monolo...
Autom editor  video blooper recognition and localization for automatic monolo...Autom editor  video blooper recognition and localization for automatic monolo...
Autom editor video blooper recognition and localization for automatic monolo...
 
Artificial intelligence and open source
Artificial intelligence and open sourceArtificial intelligence and open source
Artificial intelligence and open source
 
Bots in robotic process automation
Bots in robotic process automationBots in robotic process automation
Bots in robotic process automation
 
Multimodal emotion recognition at utterance level with spatio-temporal featur...
Multimodal emotion recognition at utterance level with spatio-temporal featur...Multimodal emotion recognition at utterance level with spatio-temporal featur...
Multimodal emotion recognition at utterance level with spatio-temporal featur...
 
Changing paradigms in ai prototyping
Changing paradigms in ai prototypingChanging paradigms in ai prototyping
Changing paradigms in ai prototyping
 
Inteligencia Artificial From Zero to Hero
Inteligencia Artificial From Zero to HeroInteligencia Artificial From Zero to Hero
Inteligencia Artificial From Zero to Hero
 
Bots for Crowds
Bots for CrowdsBots for Crowds
Bots for Crowds
 
ExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge WorkersExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
ExperTwin: An Alter Ego in Cyberspace for Knowledge Workers
 
Enabling Expert Critique with Chatbots and Micro-Guidance - Ci 2018
Enabling Expert Critique with Chatbots and Micro-Guidance - Ci 2018Enabling Expert Critique with Chatbots and Micro-Guidance - Ci 2018
Enabling Expert Critique with Chatbots and Micro-Guidance - Ci 2018
 
Cómo vivir de la inteligencia artificial
Cómo vivir de la inteligencia artificialCómo vivir de la inteligencia artificial
Cómo vivir de la inteligencia artificial
 
Education 3.0 - Megatendencias
Education 3.0 - MegatendenciasEducation 3.0 - Megatendencias
Education 3.0 - Megatendencias
 
Understanding Political Manipulation and Botnets - RightsCon
Understanding Political Manipulation and Botnets - RightsConUnderstanding Political Manipulation and Botnets - RightsCon
Understanding Political Manipulation and Botnets - RightsCon
 
Understanding Chatbot-Mediated Task Management
Understanding Chatbot-Mediated Task ManagementUnderstanding Chatbot-Mediated Task Management
Understanding Chatbot-Mediated Task Management
 
Single sign on spanish - guía completa
Single sign on   spanish - guía completaSingle sign on   spanish - guía completa
Single sign on spanish - guía completa
 
Los empleos del futuro en Latinoamérica
Los empleos del futuro en LatinoaméricaLos empleos del futuro en Latinoamérica
Los empleos del futuro en Latinoamérica
 
Empleos que ya están siendo reemplazados por bots y el futuro del RPA (Roboti...
Empleos que ya están siendo reemplazados por bots y el futuro del RPA (Roboti...Empleos que ya están siendo reemplazados por bots y el futuro del RPA (Roboti...
Empleos que ya están siendo reemplazados por bots y el futuro del RPA (Roboti...
 
RPA (Robotic Process Automation)
RPA (Robotic Process Automation)RPA (Robotic Process Automation)
RPA (Robotic Process Automation)
 
Chatbots + rpa (robotic process automation)
Chatbots + rpa (robotic process automation)Chatbots + rpa (robotic process automation)
Chatbots + rpa (robotic process automation)
 
Estrategias tecnológicas de crecimiento acelerado para startups
Estrategias tecnológicas de crecimiento acelerado para startupsEstrategias tecnológicas de crecimiento acelerado para startups
Estrategias tecnológicas de crecimiento acelerado para startups
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

How to implement artificial intelligence solutions

  • 6. You during the talk ...
  • 7. You after the talk ...
  • 8. Index ● Overview ● Discriminative techniques ● Machine Learning ● Deep Learning ● Reinforcement Learning ● Generative techniques ● Conclusions
  • 12.
  • 14. What is Artificial Intelligence? Artificial intelligence (Artificial Intelligence, or AI) is the simulation of human intelligence processes by machines, especially computer systems. These processes include learning (the acquisition of information and rules for the use of information), reasoning (using the rules to reach approximate or definitive conclusions) and self-correction.
  • 15.
  • 16. Predictions of the Mexican elections
  • 17. World Cup Predictions They are not usually very accurate since there are many factors at play.
  • 18. It is able to understand us Although we give very basic concepts, AI can create more complex concepts.
  • 19. Create videos controlling a person It has been possible to create videos supplanting someone's identity.
  • 20. Songs composed by AI Song that is composed from the sound (hum) of the human voice.
  • 21.
  • 22. 1958 The computer will be the first device to think as the human brain. It can understand its surroundings, recognize you speak your name and translate in real time. It is possible to build brains that could reproduce themselves on an assembly and which would be conscious of their existence. Rosenblatt murio en un accidente
  • 23. Geoffrey Hinton is the father of neural networks
  • 24. Fun fact about George Boole Geoffrey Hinton is a great-great-great-great grandson of George Boole. He changed the world from the mechanical industrial era to the digital era.
  • 25. AI is also in the interest of governments Geoffrey Hinton currently resides in Canada and the government is investing in being a reference in the AI scene.
  • 26.
  • 27. Getting started in Artificial Intelligence
  • 28. How do I start? The first thing you should know is that you start either as an implementer of existing techniques or as a creator of new techniques.
  • 29. Creator of new techniques (Scientist) In order to propose new algorithms, deep knowledge is required in several areas, including: ● Linear algebra ● Statistics ● Equation systems ● Calculus ● Parallel computing ● Data structures ● Programming languages (usually C or Python) … Among other areas
  • 30. As an implementer you just need to know how each technique differs from another and know which one to use depending on the problem. The process of implementing only implies adapting the inputs to which each algorithm requires, without the need to program a new algorithm. This requires: ● Data processing ● Programming languages (usually C or Python) ● Parallel computing Among others Implementer of existing techniques (Engineering)
  • 31. This talk will focus on how to implement While it is true that the great discoveries come from the generation of new algorithms, reaching a sufficient level of understanding of the foundations of artificial intelligence takes time and usually requires postgraduate studies. As an implementer you will eventually be able to improve existing techniques.
  • 32. The evolution of the methods A simple way to understand how to implement AI is compared to a conventional programming method. A method is a piece of code that runs and returns a result, example: house_price = get_price( house_location ) The result can be searched in a database or calculated based on an existing formula (existing rules).
  • 33. The evolution of the methods When we implement an AI technique, it is implemented in a manner similar to a method, but there is no defined formula to obtain the result, and it returns 2 values, a predicted value and the percentage of certainty. precio_casa, certainty_percentage = predict_price( house_location ) The result is inferred based on previous data. There is no exact formula, it is always estimated based on similar data.
  • 34. To start a classic example is the Hot Dog and No Hot Dog. For that hundreds of Hot Dogs photos and hundreds of photos of anything else are collected. With that many of the techniques detect precisely if there is a Hot Dog. This is what the function would look like detected_class, certainty_percentage = is_a_hot_dog( image ) Where the detected_class is “Hot Dog” And certainty_percentage ranges from 0 to 1 If the value is higher to a threshold (i.e. 0.5) then It is a Hot Dog The most basic example: Hot dog / Not Hot Dog
  • 36. Hot dog / Not Hot Dog use case As in the SIlicon Valley series
  • 37. Detecting cats and dogs In this case we need 3 data sets, hundreds of photos of dogs, hundreds of cats and hundreds of anything else. detected_classes, certainty_percentages = cat_or_dog( images ) Because they are more than one category, the function returns a data array, where: detected_classes[0] is “dog” y certainty_percentages[0] is 0.2 detected_classes[1] is “cat” y certainty_percentages[1] is 0.7 detected_classes[2] is “other” y certainty_percentages[2] is 0.1 Then it is more likely to be a cat.
  • 38. Self-driving cars use the same principles A car that drives itself, even if it sounds very complex, is just the implementation of several AI functions, this is a very simple example: detected_classes, certainty_percentages = vision_sensor_1( camera_image ) IF detected_classes[0] == ‘Another car’ and certainty_percentages[0] < .1 AND detected_classes[1] == ‘Pedestrian’ and certainty_percentages[1] < .1 Then SWITCH_LINE()
  • 39. Autonomous car engineers use models Dedicated to making autonomous cars is something very attainable for anyone, since the vast majority of tests are done on models and not on real cars. Once it is 100% efficient in models, tests are carried out on cars. An autonomous car laboratory can be set up at a very low cost.
  • 40. Classification and Regression We have already learned these concepts with examples of Supervised Learning Regression predicts a value, as in the case of the house, a house closer to a shopping center and main roads, returns a value in larger price, example 1,000,000 Classification predicts a category, in the examples the "classes" or categories to search are returned and based on that it returns us if it is "dog" or "cat". We know in advance the categories.
  • 41. But there is an extra case (Clustering) When we don't know the categories of the data (Unsupervised Learning) we need the computer to group those that resemble each other, then give them a name: class_found, certainty_percentage = find_category( data[0] ) class_found, certainty_percentage = find_category( data[1] ) class_found, certainty_percentage = find_category( data[2] ) This case is called Clustering. An example may be to give pictures of drawn letters, the result should be to group them into separate letters.
  • 42. Now you know the basics With what has been learned, it is enough to raise a problem and solve it using different types of learning, now we will see what techniques exist and when each one is used.
  • 43. Now it’s time to learn how to implement it
  • 44. Machine Learning requires proper data Machine Learning is the general concept of how a computer can learn. Learning comes from receiving new information and adapting its parameters to correctly identify new cases. This requires a lot of information, but you also need to know what parameters ("features") to analyze.
  • 45. Features? Yes, we need to find based on what parameters to differentiate from one another, for example there are very similar species of fish. In what characteristics would you identify to identify them. Color, size, number of fins?
  • 46. The next step is to “annotate” (labeling) Since we have each record of each specimen now manually we must specify what "class" is, for example: And then when unseen data are presented, we can predict. Color Size Fins CLASS Golden 20 5 Tilapia Silver 10 6 Tuna Silver 30 6 Salmon Color Size Fins CLASS Silver 20 6 ???
  • 47. With the Classes and Features we can start Ready now if we can feed any algorithm to get a result. The most used are: ● kNN ● Bayes ● Support Vector Machines ● Neural Networks ● Decision Trees ● Random Forest ● ... Among many others
  • 48. Now we have to train the model Once we have the Classes, the Features and choose an algorithm. We proceed to train it, the outcome is a file called Model with the rules to classify data not seen before.
  • 49. But without good features, it won't be accurate Example: To predict The features are not enough, we need to gather more data or features that are more discriminative. Color Size Fins CLASS Golden 20 5 Tilapia Silver 10 6 Tuna Silver 30 6 Salmon Color Size Fins CLASS Silver 20 6 ???
  • 50. Preparing the proper data is vital
  • 51. Let's get our hands dirty
  • 56.
  • 60. Code from sklearn.linear_model import LinearRegression from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = LinearRegression() classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 62. When to use it? ● Simple regression problems ○ How much the rent should cost in certain area ○ How much should I charge for specific amount of work ● Problems where we want to define a rule that separates two categories that are similar, i.e. Premium or Basic price for customers under certain parameters (number of rooms vs number of cars)
  • 63.
  • 64. XOR problem - Not linear
  • 66. Code from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier, export_graphviz import pydotplus iris = load_iris() clf = DecisionTreeClassifier().fit(iris.data, iris.target) dot_data = export_graphviz(clf, out_file=None, filled=True, rounded=True, feature_names=iris.feature_names, class_names=['Versicolor','Setosa','Virginica']) graph = pydotplus.graph_from_dot_data(dot_data)
  • 68. When to use it? ● When we need to know what decisions the machine is taking ● When we need to explain to others how the features are evaluated ● When there are no much features
  • 70. Code from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = RandomForestClassifier(n_estimators=100) classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 71. When to use it? ● When we want to know alternatives of how to evaluate a problem. ● When we want to manually discard flows that are biased ● When we want to manage ensembles from one single method.
  • 75. Code from sklearn.naive_bayes import GaussianNB from sklearn.linear_model import LinearRegression from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = GaussianNB() classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 76. When to use it? ● When we want to know the probabilities of the different cases. ● When we need a probabilistic model. ● When we need an easy way to prove in paper.
  • 82. Code from sklearn.linear_model import LinearRegression from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.neighbors import NearestNeighbors iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = NearestNeighbors(n_neighbors=5) classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 83. When to use it? ● When intuition says that the problem can be solved from getting thee most similar option. ● When the information is no exhaustive. ● When we want to justify the decision of the algorithm in a common human reasoning.
  • 86. Code from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.preprocessing import scale digits = load_digits() data = scale(digits.data) reduced_data = PCA(n_components=2).fit_transform(data) print(reduced_data) kmeans = KMeans(init='k-means++', n_clusters=10, n_init=10) kmeans.fit(reduced_data) kmeans.predict(reduced_data[:10])
  • 87. When to use it? ● When we don’t know how to understand the data ● When we want to optimize resources by grouping related elements. ● When we want that the computer creates the labels for us.
  • 90. Code from sklearn.datasets import load_iris from sklearn.svm import SVC from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) classifier = SVC() classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 91. When to use it? ● It was the most effective technique before Neural Networks, it can achieve excellent results with less processing. ● Mathematically speaking, it is based in very strong math principles, it creates complex multidimensional hyperplanes that separates the classes precisely. ● It is not a white box technique, but may be the best option for problems where we want to get the best of Machine Learning approach without dealing with Neural Networks.
  • 93. Code from sklearn.linear_model import LogisticRegression from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.neighbors import NearestNeighbors iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = LogisticRegression(multi_class='multinomial') classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 94. When to use it? ● When we want to optimize a regression ● When we want to binarize the output ● As a preliminary analysis before implementing neural networks
  • 96. Code from sklearn.linear_model import Perceptron from sklearn.datasets import load_iris from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.neighbors import NearestNeighbors iris = load_iris() X_train, X_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2) clf = Perceptron() classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print('accuracy is',accuracy_score(y_pred, y_test))
  • 97. When to use it? ● When we have very few features and there is no extra details that can be extracted from hidden layers. ● There are in fact neural networks, and we do not need alway to use them for deep learning these can be used for machine learning when we benchmark with other machine learning techniques. ● When we want to get the power of neural networks and we don’t have much computational power.
  • 98. That was machine learning
  • 99. ML & DL frameworks
  • 100. It’s time for Deep Learning
  • 104. Artificial Neural Networks = Multi-Layer Perceptron
  • 108.
  • 113. ANN - Decision boundary
  • 114. ANN - Decision boundary
  • 115. ANN - Performance metrics
  • 119. When to use it? ● Classifiers when common machine Learning Algorithms performs poorly. ● Models with much features. ● Multiple classes projects.
  • 121. MNIST
  • 122.
  • 123.
  • 124.
  • 125.
  • 126. All that knowledge to train a CNN to do this ...
  • 128. When to use it? ● When we want to process images ● When we want to process videos ● When we have highly dimensional data.
  • 130. RNN These have memory that keeps the context.
  • 132. When to use it? ● When sequences are provided ○ Text sequences ○ Image sequences (videos) ○ Time series ● When we need to provide an ordered output
  • 133. That’s all for Deep Learning techniques
  • 136. Mixed Deep learning features
  • 137. When to use it? ● When we want to benchmark models ● When different models are stronger when these are evaluated together ● When the individual processing is not exhaustive
  • 138. AutoML
  • 139. Frameworks ● TPOT ● MLBox ● H2O ● Google AutoML
  • 140. When to use it? ● On every new model ● When we have enough time to train multiple models ● When we don’t know wich hyperparameters are better.
  • 141. Last but not least - Reinforcement Learning
  • 144.
  • 145. Frameworks ● OpenAI Gym ● Google Dopamine ● RLLib ● Keras-RL ● Tensorforce ● Facebook Horizon
  • 146. When to use it? ● When a robot explores a place and needs to learn from the environment. ● When we can try as much as we can in a simulator. ● When we want to find the most optimal path
  • 147. Techniques to improve the learning process
  • 148. Principal Component Analysis (PCA) Feature selection
  • 149. When to use it? ● When we have too much features and we do not know which of them are useful. ● When we want to reduce the dimensionality of our model. ● When we want to plot our decision boundaries.
  • 151. When to use it? ● When we have limited data ● When we want to help our model to generalize more ● When our unseen data comes in very different formats.
  • 152. That was too much information!
  • 154. Follows the data distribution
  • 156. Generative: Generates from data distribution
  • 157. Examples of Generative Artificial The following images intermix the styles of two domains
  • 158. Generative models ● Autoencoders ● Adversarial Networks ● Sequence Models ● Transformers
  • 163. When to use it? ● When we want to compress data. ● When we need to change one type of input to other type of output. ● When we don’t need much variability in the generated data.
  • 165. When to use it? ● When we need to transfer a style ● When we need more variability in the generated output ● When we need to keep context in the generation.
  • 167. When to use it? ● When we generate text ● When we generate the next sequence from a serie ● When the order in the generated output matters.
  • 168.
  • 169. When to use it? ● When context is an essential part of the generated output ● When we need to keep consistency in the frequency space. ● When we have enough computational resources.
  • 170. Summary ● Predict values from numeric features (Regression) ○ Linear regression ○ Polynomial regressions ○ Any machine learning technique without an activation function ● Predict categories from labeled numeric data (Classification) ○ Logistic Regression ○ k-Nearest Neighbors ○ Decision Tree ○ Random Forest ○ Support Vector Machine ○ Perceptron ○ Multi Layer Perceptron ○ Naive Bayes
  • 171. Summary ● Find labels from unlabeled data (Clustering) ○ K-means ○ LDA ○ NMF ● Detect objects in an image (Classification) ○ Convolutional Neural Networks ● Detect the category of a text or video (Classification) ○ Recurrent Neural Networks ● Learn to navigate and find optimal paths (Try and error) ○ Reinforcement Learning ● Generate images ○ Autoencoders ○ Generative Adversarial Networks
  • 172. Summary ● Generate audio and text ○ Sequence models ○ Transformers ● Explainable approaches ○ k-Nearest Neighbors ○ Naive Bayes ○ Decision Trees ○ Linear regression ○ K-means
  • 173. Resources ● Working examples ready to run online (Jupyter) ○ http://bit.ly/awesome-machine-learning ● Communities around the world ○ http://theschool.ai
  • 174. Conclusions ● Depending on the application that we want to develop we need different techniques and frameworks ● The model training is the 20% of the work, processing the data to have something useful is the remaining 80%. ● We need a lot of data to train a model, if you don’t have enough data, there are always augmentation from transformations and generations techniques to create more synthetic data form the existing. ● We don’t need to be a data scientist to implement Artificial Intelligence solutions, we only need to know how the techniques work and how to tune up. ● Now that you know everything you need, it's time to put it into practice.

Notes de l'éditeur

  1. This is how neural networks process the images to predict an output