[R-sig-Geo] accuracy assessment of tematic maps in R

Ali Santacruz amsantac at hotmail.com
Thu Dec 31 15:02:26 CET 2015


 
Dear Cristian,
 
The confusion matrix can be produced using the crosstab function from the raster package or the crosstabm function from the diffeR package,
 
You may also want to take a look at the difference metrics for comparing maps based on the confusion matrix from the diffeR package. If you are also interested in producing ROC curves, check out the TOC package.
 
Best,
 
Ali

 
> To: r-sig-geo at r-project.org
> From: bfalevlist at gmail.com
> Date: Thu, 31 Dec 2015 09:10:41 +0100
> Subject: Re: [R-sig-Geo] accuracy assessment of tematic maps in R
> 
> Dear Cristián,
> there migt be several packages that can compute confusion matrix (aka. 
> contingency table):
> ??contingency
> 
> One of them that I can recommend you is package 'ROCR' and functions 
> ROCR::prediction() and ROCR::performance().
> 
> ## Creates a ROCR::prediction object:
> ROCR_object <- prediction(predictions = predicted_values, labels = 
> observed_values)
> 
> ## Calculates performance measures:
> AUC_value <- performance(prediction.obj = ROCR_object, measure = 
> "auc")@y.values[[1]]
> TPR_value <- performance(prediction.obj = ROCR_object, measure = 
> "tpr")@y.values[[1]]
> 
> ## Calculates performance graphs:
> ROC_curve <- performance(prediction.obj = ROCR_object, measure = "tpr", 
> x.measure = "fpr")
> precision_recall <- performance(prediction.obj = ROCR_object, measure = 
> "prec", x.measure = "rec")
> sensitivity_specificity <- performance(prediction.obj = ROCR_object, 
> measure = "sens", x.measure = "spec")
> plot(ROC_curve)
> plot(precision_recall)
> plot(sensitivity_specificity)
> 
> HTH,
> Ákos Bede-Fazekas
> Hungary
> 
> 2015.12.31. 4:31 keltezéssel, CRISTIAN ANDRES VERGARA FERNANDEZ írta:
> > Dear all,
> >
> > I have done a number of land cover maps using support vector machine from
> > landsat 8. I would like to automatize an accuracy assessment procedure
> > based on a confusion matrix to evaluate the classification maps obtained. I
> > have not been able to easily find a package containing the confusion matrix
> > function. Would you recommend me a way to do this using R?
> >
> > Many thanks in advance
> >
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list