ee.ConfusionMatrix.array

แสดงผลเมทริกซ์ความสับสนเป็นอาร์เรย์

การใช้งานการคืนสินค้า
ConfusionMatrix.array()อาร์เรย์
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ confusionMatrixConfusionMatrix

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

// Construct a confusion matrix from an array (rows are actual values,
// columns are predicted values). We construct a confusion matrix here for
// brevity and clear visualization, in most applications the confusion matrix
// will be generated from ee.Classifier.confusionMatrix.
var array = ee.Array([[32, 0, 0,  0,  1, 0],
                      [ 0, 5, 0,  0,  1, 0],
                      [ 0, 0, 1,  3,  0, 0],
                      [ 0, 1, 4, 26,  8, 0],
                      [ 0, 0, 0,  7, 15, 0],
                      [ 0, 0, 0,  1,  0, 5]]);
var confusionMatrix = ee.ConfusionMatrix(array);
print("ee.ConfusionMatrix", confusionMatrix);

print("ee.ConfusionMatrix as ee.Array", confusionMatrix.array());

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

# Construct a confusion matrix from an array (rows are actual values,
# columns are predicted values). We construct a confusion matrix here for
# brevity and clear visualization, in most applications the confusion matrix
# will be generated from ee.Classifier.confusionMatrix.
array = ee.Array([[32, 0, 0,  0,  1, 0],
                  [ 0, 5, 0,  0,  1, 0],
                  [ 0, 0, 1,  3,  0, 0],
                  [ 0, 1, 4, 26,  8, 0],
                  [ 0, 0, 0,  7, 15, 0],
                  [ 0, 0, 0,  1,  0, 5]])
confusion_matrix = ee.ConfusionMatrix(array)
print("ee.ConfusionMatrix:")
pprint(confusion_matrix.getInfo())

print("ee.ConfusionMatrix as ee.Array:")
pprint(confusion_matrix.array().getInfo())