Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples of the Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Cellular Automata
Chemistry
Complex Systems
Computer Science
Computer Vision
Control Systems
Creative Arts
Data Science
Engineering
Finance & Economics
Finite Element Method
Food & Nutrition
Geography
Geometry
Graphs & Networks
Image Processing
Life Sciences
Machine Learning
Mathematics
Optimization
Physics
Puzzles and Recreation
Quantum Computation
Signal Processing
Social Sciences
System Modeling
Text & Language Processing
Time-Related Computation
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Resource
Learn More about
Wolfram Language
Related Pages
Related Symbols
ImageKeypoints
Classify
NetTrain
NetModel
NetChain
NetMeasurements
FeatureSpacePlot3D
FeatureSpacePlot
Related Categories
Machine Learning
Image Processing
Train LeNet to Classify Images of FashionMNIST
Classify images of a dataset of labeled fashion images
Example Notebook
Open in Cloud
Download Notebook
Get the necessary data from the
Wolfram Data Repository
:
I
n
[
1
]
:
=
t
r
a
i
n
i
n
g
D
a
t
a
=
R
e
s
o
u
r
c
e
D
a
t
a
[
"
F
a
s
h
i
o
n
M
N
I
S
T
"
,
"
T
r
a
i
n
i
n
g
D
a
t
a
"
]
;
t
e
s
t
D
a
t
a
=
R
e
s
o
u
r
c
e
D
a
t
a
[
"
F
a
s
h
i
o
n
M
N
I
S
T
"
,
"
T
e
s
t
D
a
t
a
"
]
;
I
n
[
2
]
:
=
c
l
a
s
s
e
s
=
{
0
"
T
-
s
h
i
r
t
/
t
o
p
"
,
1
"
T
r
o
u
s
e
r
"
,
2
"
P
u
l
l
o
v
e
r
"
,
3
"
D
r
e
s
s
"
,
4
"
C
o
a
t
"
,
5
"
S
a
n
d
a
l
"
,
6
"
S
h
i
r
t
"
,
7
"
S
n
e
a
k
e
r
"
,
8
"
B
a
g
"
,
9
"
A
n
k
l
e
b
o
o
t
"
}
;
Get a random sample of the dataset:
I
n
[
3
]
:
=
G
r
o
u
p
B
y
[
t
r
a
i
n
i
n
g
D
a
t
a
,
L
a
s
t
F
i
r
s
t
,
R
a
n
d
o
m
C
h
o
i
c
e
]
/
/
K
e
y
S
o
r
t
O
u
t
[
3
]
=
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
Train a small model to classify the images, using 10% of the data as a validation set:
I
n
[
4
]
:
=
f
a
s
h
i
o
n
N
e
t
=
N
e
t
T
r
a
i
n
[
N
e
t
M
o
d
e
l
[
"
L
e
N
e
t
"
]
,
t
r
a
i
n
i
n
g
D
a
t
a
,
V
a
l
i
d
a
t
i
o
n
S
e
t
S
c
a
l
e
d
[
.
1
]
]
O
u
t
[
4
]
=
N
e
t
C
h
a
i
n
I
n
p
u
t
p
o
r
t
:
i
m
a
g
e
O
u
t
p
u
t
p
o
r
t
:
c
l
a
s
s
Use the test dataset to compute the accuracy of the final classifier:
I
n
[
5
]
:
=
N
e
t
M
e
a
s
u
r
e
m
e
n
t
s
[
f
a
s
h
i
o
n
N
e
t
,
t
e
s
t
D
a
t
a
,
"
A
c
c
u
r
a
c
y
"
]
O
u
t
[
5
]
=
0
.
9
1
0
7
Visualize the confusion matrix of the classifier:
I
n
[
6
]
:
=
N
e
t
M
e
a
s
u
r
e
m
e
n
t
s
[
f
a
s
h
i
o
n
N
e
t
,
t
e
s
t
D
a
t
a
,
"
C
o
n
f
u
s
i
o
n
M
a
t
r
i
x
P
l
o
t
"
]
O
u
t
[
6
]
=
a
c
t
u
a
l
c
l
a
s
s
p
r
e
d
i
c
t
e
d
c
l
a
s
s
Visualize the average receiver operating characteristic (ROC) curve for every class. This plot shows the relation between the true positive rate (or recall) and the false positive rate (or fall-out) in a binary classifier:
I
n
[
7
]
:
=
L
i
s
t
L
i
n
e
P
l
o
t
V
a
l
u
e
s
[
T
r
a
n
s
p
o
s
e
/
@
N
e
t
M
e
a
s
u
r
e
m
e
n
t
s
[
f
a
s
h
i
o
n
N
e
t
,
t
e
s
t
D
a
t
a
,
"
R
O
C
C
u
r
v
e
"
]
]
,
O
u
t
[
7
]
=
T
-
s
h
i
r
t
/
t
o
p
T
r
o
u
s
e
r
P
u
l
l
o
v
e
r
D
r
e
s
s
C
o
a
t
S
a
n
d
a
l
S
h
i
r
t
S
n
e
a
k
e
r
B
a
g
A
n
k
l
e
b
o
o
t
Compute the average ROC across all the classes:
I
n
[
8
]
:
=
r
o
c
L
i
s
t
=
I
n
t
e
r
p
o
l
a
t
i
o
n
@
*
V
a
l
u
e
s
@
*
(
G
r
o
u
p
B
y
[
#
1
,
F
i
r
s
t
,
M
e
a
n
]
&
)
@
*
T
r
a
n
s
p
o
s
e
/
@
V
a
l
u
e
s
[
N
e
t
M
e
a
s
u
r
e
m
e
n
t
s
[
f
a
s
h
i
o
n
N
e
t
,
t
e
s
t
D
a
t
a
,
"
R
O
C
C
u
r
v
e
"
]
]
;
L
i
s
t
L
i
n
e
P
l
o
t
T
a
b
l
e
[
{
i
,
W
i
t
h
[
{
m
=
M
e
a
n
[
#
]
}
,
A
r
o
u
n
d
[
m
,
{
m
-
M
i
n
[
#
]
,
M
a
x
[
#
]
-
m
}
]
]
&
@
Q
u
i
e
t
[
T
h
r
o
u
g
h
[
r
o
c
L
i
s
t
[
i
]
]
]
}
,
{
i
,
0
.
0
,
.
1
,
.
1
/
3
0
}
]
,
O
u
t
[
8
]
=
Use
F
e
a
t
u
r
e
S
p
a
c
e
P
l
o
t
3
D
with the features extracted by the net to build a 3D visualization for the dataset content:
I
n
[
9
]
:
=
F
e
a
t
u
r
e
S
p
a
c
e
P
l
o
t
3
D
[
K
e
y
s
[
R
a
n
d
o
m
S
a
m
p
l
e
[
t
e
s
t
D
a
t
a
,
1
0
0
0
]
]
,
F
e
a
t
u
r
e
E
x
t
r
a
c
t
o
r
N
e
t
D
r
o
p
[
f
a
s
h
i
o
n
N
e
t
,
-
1
]
,
I
m
a
g
e
S
i
z
e
M
e
d
i
u
m
]
O
u
t
[
9
]
=
See Also
Classify Spoken Digits
Train a Custom Image Classifier
FashionMNIST
MNIST
LeNet Trained on MNIST Data
Related Symbols
ImageKeypoints
Classify
NetTrain
NetModel
NetChain
NetMeasurements
FeatureSpacePlot3D
FeatureSpacePlot
Publisher Information
Contributed by:
Wolfram Staff