הודעה : כל הפרויקטים הלא מסחריים שנרשמו לשימוש ב-Earth Engine לפני
15 באפריל 2025 חייבים
לאמת את הזכאות לשימוש לא מסחרי כדי לשמור על הגישה. אם לא תאמתו את החשבון עד 26 בספטמבר 2025, יכול להיות שהגישה שלכם תושעה.
שליחת משוב
ee.ConfusionMatrix
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יוצרת מטריצת בלבול. ציר 0 (השורות) של המטריצה מתאים לערכים בפועל, וציר 1 (העמודות) מתאים לערכים החזויים.
שימוש החזרות ee.ConfusionMatrix(array, order )
ConfusionMatrix
ארגומנט סוג פרטים array
אובייקט מערך דו-ממדי של מספרים שלמים, שמייצג את מטריצת השגיאה. שימו לב: בניגוד ל-constructor של 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 ());
הגדרת Python
מידע על Python API ועל שימוש ב-geemap
לפיתוח אינטראקטיבי מופיע בדף
Python Environment .
import ee
import geemap.core as geemap
Colab (Python)
from pprint import pprint
# 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 ]])
print ( 'Constructed confusion matrix:' )
pprint ( ee . ConfusionMatrix ( array ) . getInfo ())
# 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 , None ) . order () . getInfo ())
# 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 ]
print ( 'Specified row/column labels (specified "order" parameter):' ,
ee . ConfusionMatrix ( array , order ) . order () . getInfo ())
שליחת משוב
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0 . לפרטים, ניתן לעיין במדיניות האתר Google Developers . Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
רוצה לתת לנו משוב?
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],[]]