ee.ConfusionMatrix.order
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نام و ترتیب سطرها و ستونهای ماتریس را برمیگرداند.
استفاده | برمی گرداند | ConfusionMatrix. order () | فهرست کنید |
استدلال | تایپ کنید | جزئیات | این: confusionMatrix | ConfusionMatrix | |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
// 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());
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
# 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())
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eConfusionMatrix.order()\u003c/code\u003e returns a list containing the names and order of rows and columns within the confusion matrix.\u003c/p\u003e\n"],["\u003cp\u003eBy default, \u003ccode\u003eConfusionMatrix\u003c/code\u003e automatically assigns an order to rows and columns if not explicitly specified.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define a custom order for rows and columns when creating a \u003ccode\u003eConfusionMatrix\u003c/code\u003e using the \u003ccode\u003eorder\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eThis function is crucial for understanding the structure and organization of a confusion matrix, especially when interpreting its values.\u003c/p\u003e\n"]]],["The `ConfusionMatrix.order()` method returns a list representing the name and order of the rows and columns within a confusion matrix. By default, this order is determined by the matrix's structure. Users can specify a custom order when creating the `ConfusionMatrix`, which will then be reflected in the output of `order()`. The examples illustrate how to retrieve both the default and a user-defined row and column order.\n"],null,["# ee.ConfusionMatrix.order\n\nReturns the name and order of the rows and columns of the matrix.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------|---------|\n| ConfusionMatrix.order`()` | List |\n\n| Argument | Type | Details |\n|-------------------------|-----------------|---------|\n| this: `confusionMatrix` | ConfusionMatrix | |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Construct an error/confusion matrix from an array (rows are actual values,\n// columns are predicted values). We construct an error matrix here for brevity\n// and matrix visualization, in most applications the confusion matrix will be\n// 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]]);\n\nvar cmDefaultOrder = ee.ConfusionMatrix(array);\nprint('Default name and order of the rows and columns',\n cmDefaultOrder.order());\n\nvar order = [11, 22, 42, 52, 71, 81];\nvar cmSpecifiedOrder = ee.ConfusionMatrix({array: array, order: order});\nprint('Specified name and order of the rows and columns',\n cmSpecifiedOrder.order());\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\n# Construct an error/confusion matrix from an array (rows are actual values,\n# columns are predicted values). We construct an error matrix here for brevity\n# and matrix visualization, in most applications the confusion matrix will be\n# 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]])\n\ncm_default_order = ee.ConfusionMatrix(array)\nprint('Default name and order of the rows and columns:',\n cm_default_order.order().getInfo())\n\norder = [11, 22, 42, 52, 71, 81]\ncm_specified_order = ee.ConfusionMatrix(array, order)\nprint('Specified name and order of the rows and columns:',\n cm_specified_order.order().getInfo())\n```"]]