| इस्तेमाल | रिटर्न |
|---|---|
ee.ConfusionMatrix(array, order) | ConfusionMatrix |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|---|---|
array | ऑब्जेक्ट | पूर्णांकों की स्क्वेयर, 2D सरणी, जो भ्रमित करने वाले मैट्रिक्स को दिखाती है. ध्यान दें कि ee.Array कंस्ट्रक्टर के उलट, यह तर्क सूची नहीं ले सकता. |
order | सूची, डिफ़ॉल्ट: null | बिना किसी क्रम के या शून्य से शुरू न होने वाले मैट्रिक्स के लिए, पंक्ति और कॉलम का साइज़ और क्रम. |
उदाहरण
कोड एडिटर (JavaScript)
// A confusion matrix. Rows correspond to actual values, columns to // predicted values. 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]]); print('Constructed confusion matrix', ee.ConfusionMatrix(array)); // The "order" parameter refers to row and column class labels. When // unspecified, the class labels are assumed to be a 0-based sequence // incrementing by 1 with a length equal to row/column size. print('Default row/column labels (unspecified "order" parameter)', ee.ConfusionMatrix({array: array, order: null}).order()); // Set the "order" parameter when custom class label integers are required. The // list of integer value labels should correspond to the matrix axes left to // right / top to bottom. var order = [11, 22, 42, 52, 71, 81]; print('Specified row/column labels (specified "order" parameter)', ee.ConfusionMatrix({array: array, order: order}).order());
import ee import geemap.core as geemap
Colab (Python)
# A confusion matrix. Rows correspond to actual values, columns to # predicted values. 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]]) display('Constructed confusion matrix:', ee.ConfusionMatrix(array)) # The "order" parameter refers to row and column class labels. When # unspecified, the class labels are assumed to be a 0-based sequence # incrementing by 1 with a length equal to row/column size. display('Default row/column labels (unspecified "order" parameter):', ee.ConfusionMatrix(array, None).order()) # Set the "order" parameter when custom class label integers are required. The # list of integer value labels should correspond to the matrix axes left to # right / top to bottom. order = [11, 22, 42, 52, 71, 81] display('Specified row/column labels (specified "order" parameter):', ee.ConfusionMatrix(array, order).order())