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 Environment.
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())
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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```"]]