accuracy assessment of tematic maps in R

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

accuracy assessment of tematic maps in R

cristianvergaraf
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

--
--
Atte.,

*Mg. Cristián Andrés Vergara Fernández*

*ProfesionalLicenciado en Ciencias de los Recursos Naturales
RenovablesMagister en Biodiversidad: Conservación y Evolución *
Laboratorio de Planificación Territorial
Universidad Católica de Temuco

*Contacto: ** +56 9 62175676*


*Antes de imprimir este correo electrónico piense bien si es necesario
hacerlo: El medio ambiente es responsabilidad de todos.*

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: accuracy assessment of tematic maps in R

Bede-Fazekas Ákos
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
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: accuracy assessment of tematic maps in R

Ali Santacruz
 
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: [hidden email]
> From: [hidden email]
> 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
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
     
        [[alternative HTML version deleted]]


_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: accuracy assessment of tematic maps in R

Tim Meehan
In reply to this post by cristianvergaraf
You can try the confusion matrix functions in 'caret'.  Best, Tim

2015-12-30 20:31 GMT-07:00 CRISTIAN ANDRES VERGARA FERNANDEZ <
[hidden email]>:

> 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
>
> --
> --
> Atte.,
>
> *Mg. Cristián Andrés Vergara Fernández*
>
> *ProfesionalLicenciado en Ciencias de los Recursos Naturales
> RenovablesMagister en Biodiversidad: Conservación y Evolución *
> Laboratorio de Planificación Territorial
> Universidad Católica de Temuco
>
> *Contacto: ** +56 9 62175676*
>
>
> *Antes de imprimir este correo electrónico piense bien si es necesario
> hacerlo: El medio ambiente es responsabilidad de todos.*
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo