Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples for 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
Classify
ClassifierMeasurements
ExampleData
Dataset
AssociationMap
Related Categories
Machine Learning
Data Science
Confusion Matrix of a Classifier
Example Notebook
Open in Cloud
Download Notebook
Classify the land surface in a satellite image
Collect examples from a built-in dataset:
I
n
[
1
]
:
=
t
r
a
i
n
i
n
g
s
e
t
=
E
x
a
m
p
l
e
D
a
t
a
[
{
"
M
a
c
h
i
n
e
L
e
a
r
n
i
n
g
"
,
"
S
a
t
e
l
l
i
t
e
"
}
,
"
T
r
a
i
n
i
n
g
D
a
t
a
"
]
;
t
e
s
t
s
e
t
=
E
x
a
m
p
l
e
D
a
t
a
[
{
"
M
a
c
h
i
n
e
L
e
a
r
n
i
n
g
"
,
"
S
a
t
e
l
l
i
t
e
"
}
,
"
T
e
s
t
D
a
t
a
"
]
;
Train a classifier on the training set:
I
n
[
2
]
:
=
c
=
C
l
a
s
s
i
f
y
[
t
r
a
i
n
i
n
g
s
e
t
]
O
u
t
[
2
]
=
C
l
a
s
s
i
f
i
e
r
F
u
n
c
t
i
o
n
I
n
p
u
t
t
y
p
e
:
M
i
x
e
d
(
n
u
m
b
e
r
:
3
6
)
N
u
m
b
e
r
o
f
c
l
a
s
s
e
s
:
6
D
a
t
a
n
o
t
i
n
n
o
t
e
b
o
o
k
.
S
t
o
r
e
n
o
w
Get data on the performance of the classifier on the test set:
I
n
[
3
]
:
=
c
m
=
C
l
a
s
s
i
f
i
e
r
M
e
a
s
u
r
e
m
e
n
t
s
[
c
,
t
e
s
t
s
e
t
]
;
The measurement object can be queried for properties such as the accuracy of the classifier:
I
n
[
4
]
:
=
c
m
[
"
P
r
o
p
e
r
t
i
e
s
"
]
/
/
S
h
o
r
t
O
u
t
[
4
]
/
/
S
h
o
r
t
=
{
A
c
c
u
r
a
c
y
,
A
c
c
u
r
a
c
y
B
a
s
e
l
i
n
e
,
A
c
c
u
r
a
c
y
R
e
j
e
c
t
i
o
n
P
l
o
t
,
5
3
,
T
r
u
e
P
o
s
i
t
i
v
e
N
u
m
b
e
r
,
W
o
r
s
t
C
l
a
s
s
i
f
i
e
d
E
x
a
m
p
l
e
s
}
I
n
[
5
]
:
=
c
m
[
"
A
c
c
u
r
a
c
y
"
]
O
u
t
[
5
]
=
0
.
8
9
1
5
I
n
[
6
]
:
=
A
s
s
o
c
i
a
t
i
o
n
M
a
p
[
c
m
,
{
"
P
r
e
c
i
s
i
o
n
"
,
"
R
e
c
a
l
l
"
,
"
F
1
S
c
o
r
e
"
}
]
/
/
D
a
t
a
s
e
t
/
/
T
r
a
n
s
p
o
s
e
O
u
t
[
6
]
=
Compute the confusion matrix either in numeric form or as annotated graphics:
I
n
[
7
]
:
=
c
m
[
"
C
o
n
f
u
s
i
o
n
M
a
t
r
i
x
"
]
/
/
M
a
t
r
i
x
F
o
r
m
O
u
t
[
7
]
/
/
M
a
t
r
i
x
F
o
r
m
=
2
1
7
0
1
0
4
2
0
1
1
3
5
3
0
0
2
4
3
0
1
1
5
3
6
8
3
0
1
0
0
1
0
1
4
5
8
1
0
0
4
2
1
1
5
1
9
1
2
4
0
0
3
0
1
6
0
1
0
4
1
4
0
I
n
[
8
]
:
=
c
m
[
"
C
o
n
f
u
s
i
o
n
M
a
t
r
i
x
P
l
o
t
"
]
O
u
t
[
8
]
=
See Also
ConfusionMatrixToClassifierMeasurementsObject
Related Symbols
Classify
ClassifierMeasurements
ExampleData
Dataset
AssociationMap
Publisher Information
Contributed by:
Wolfram Staff