お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.ConfusionMatrix.array
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
混同行列を配列として返します。
用途 | 戻り値 |
---|
ConfusionMatrix.array() | 配列 |
引数 | タイプ | 詳細 |
---|
これ: confusionMatrix | ConfusionMatrix | |
例
コードエディタ(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())
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003eConfusionMatrix.array()\u003c/code\u003e function returns the confusion matrix as an \u003ccode\u003eee.Array\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThis function is used to access the underlying data of an \u003ccode\u003eee.ConfusionMatrix\u003c/code\u003e object for further analysis or visualization.\u003c/p\u003e\n"],["\u003cp\u003eThe confusion matrix represents the performance of a classifier, with rows indicating actual values and columns indicating predicted values.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an \u003ccode\u003eee.ConfusionMatrix\u003c/code\u003e from an existing \u003ccode\u003eee.Array\u003c/code\u003e or by using the \u003ccode\u003eee.Classifier.confusionMatrix()\u003c/code\u003e function.\u003c/p\u003e\n"]]],[],null,["# ee.ConfusionMatrix.array\n\nReturns a confusion matrix as an Array.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------|---------|\n| ConfusionMatrix.array`()` | Array |\n\n| Argument | Type | Details |\n|-------------------------|-----------------|---------|\n| this: `confusionMatrix` | ConfusionMatrix | |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Construct a confusion matrix from an array (rows are actual values,\n// columns are predicted values). We construct a confusion matrix here for\n// brevity and clear visualization, in most applications the confusion matrix\n// will be generated from ee.Classifier.confusionMatrix.\nvar array = ee.Array([[32, 0, 0, 0, 1, 0],\n [ 0, 5, 0, 0, 1, 0],\n [ 0, 0, 1, 3, 0, 0],\n [ 0, 1, 4, 26, 8, 0],\n [ 0, 0, 0, 7, 15, 0],\n [ 0, 0, 0, 1, 0, 5]]);\nvar confusionMatrix = ee.ConfusionMatrix(array);\nprint(\"ee.ConfusionMatrix\", confusionMatrix);\n\nprint(\"ee.ConfusionMatrix as ee.Array\", confusionMatrix.array());\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nfrom pprint import pprint\n\n# Construct a confusion matrix from an array (rows are actual values,\n# columns are predicted values). We construct a confusion matrix here for\n# brevity and clear visualization, in most applications the confusion matrix\n# will be generated from ee.Classifier.confusionMatrix.\narray = ee.Array([[32, 0, 0, 0, 1, 0],\n [ 0, 5, 0, 0, 1, 0],\n [ 0, 0, 1, 3, 0, 0],\n [ 0, 1, 4, 26, 8, 0],\n [ 0, 0, 0, 7, 15, 0],\n [ 0, 0, 0, 1, 0, 5]])\nconfusion_matrix = ee.ConfusionMatrix(array)\nprint(\"ee.ConfusionMatrix:\")\npprint(confusion_matrix.getInfo())\n\nprint(\"ee.ConfusionMatrix as ee.Array:\")\npprint(confusion_matrix.array().getInfo())\n```"]]