ee.ConfusionMatrix.order

행과 열의 이름과 순서를 반환합니다.

사용반환 값
ConfusionMatrix.order()목록
인수유형세부정보
다음과 같은 경우: confusionMatrixConfusionMatrix

코드 편집기 (JavaScript)

// Construct an error/confusion matrix from an array (rows are actual values,
// columns are predicted values). We construct an error matrix here for brevity
// and matrix 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 cmDefaultOrder = ee.ConfusionMatrix(array);
print('Default name and order of the rows and columns',
      cmDefaultOrder.order());

var order = [11, 22, 42, 52, 71, 81];
var cmSpecifiedOrder = ee.ConfusionMatrix({array: array, order: order});
print('Specified name and order of the rows and columns',
      cmSpecifiedOrder.order());

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

# Construct an error/confusion matrix from an array (rows are actual values,
# columns are predicted values). We construct an error matrix here for brevity
# and matrix 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]])

cm_default_order = ee.ConfusionMatrix(array)
print('Default name and order of the rows and columns:',
      cm_default_order.order().getInfo())

order = [11, 22, 42, 52, 71, 81]
cm_specified_order = ee.ConfusionMatrix(array, order)
print('Specified name and order of the rows and columns:',
      cm_specified_order.order().getInfo())