Machine Learning (ML)
using Matlab
1
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
2
Dataset
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Guardar archivo
en formato CSV
3
Dataset
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
csvwrite("data.csv",M);
4
Dataset
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Input: features Output: label
Classification
5
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
6
ML Apps
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
We select
to work
with the
workspace
data
7
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
By default
the decision
trees
algorithm
appears,
but we can
select other
algorithms
8
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select all
available
algorithms
Run the
training
process of
the
algorithms
Select one
with the
best
accuracy
9
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Selecting
the KNN
algorithm
10
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Plot of
features
Confusion
matrix
usage to
evaluate
the quality
of the
output of a
classifier
11
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Receiver
Operating
Characteris
tic curve,
or ROC
curve.
Export the
model to
.mat code
12
Classification
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Save the script
as
trainClassifier.m
13
Testing the classification algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
The classification
algorithm must
receive the dataset
labeled to train.
14
Testing the classification algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
15
Testing the classification algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Dataset different
from the training
data, this dataset
has no labels.
16
Testing the classification algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
17
Testing the classification algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Neural Network (NN)
18
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
19
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
We will use the
pattern
recognition app
Assigned probability
values per column
(Column 1 - label 1,
Column 2 - label 2, ...
Column n - label n).
20
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select Next
21
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select the Min and Mout matrices of the workspace.
Then select Next.
22
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select Next
Select the
values according
to the dataset.
23
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select Next
Select the number of
neurons according to the
application.
24
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select train
25
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select Next
26
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Select Next
27
Neural Network ToolBox
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Export the neural network as a function
28
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Save the script as
myNeuralNetworkFunction.m
Neural Network ToolBox
29
Testing NN algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
The function
receives the data
without label.
Probability of belonging to each
label (column)
30
Testing NN algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
Each Ynn row:
maximum
probability value,
cluster id.
31
Testing NN algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
32
Testing NN algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
33
Testing NN algorithm
011000010111001101100001011011100111101001100001
01101010011001010110000101101110
34
Recursos:
• Presentaciones, ejercicios resueltos y archivos VHDL:
011000010111001101100001011011100111101001100001
01101010011001010110000101101110

⭐⭐⭐⭐⭐ Machine Learning #ML using #Matlab