Accuracy assessment

Get the confusion matrix of your classifier


We created a sentinel-2 composite for Nghe An and added reference points in the GEE interface. These points were used to create a training sample to train the classifier. The code below gets the stats from your classifier

var classifier = ee.Classifier.randomForest(10,0).train(TrainingSample,"land_class",bandNames);

var confMatrix = classifier.confusionMatrix()


var OA = confMatrix.accuracy()
var CA = confMatrix.consumersAccuracy()
var Kappa = confMatrix.kappa()
var Order = confMatrix.order()
var PA = confMatrix.producersAccuracy()

print(confMatrix,'Confusion Matrix')
print(OA,'Overall Accuracy')
print(CA,'Consumers Accuracy')
print(PA,'Producers Accuracy')

find the complete example here.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s