Mostrando entradas con la etiqueta VIDEO: R-Tutorials. Mostrar todas las entradas
Mostrando entradas con la etiqueta VIDEO: R-Tutorials. Mostrar todas las entradas

27 mar 2019

Tidy Tuesday screencast: analyzing pet names in Seattle

It is always great to see David @drob  how well he works with R in their #tidytuesdays videos
 

5 mar 2018

Análisis de datos con R avanzado. Modulo II : Machine Learning

Ha habido gran interés en el primer video de esta serie, por lo que podéis continuar por este segundo, donde se ponen varios ejemplos prácticos para el uso de R en diferentes aplicaciones. El video es  bastante entretenido y pienso que incrementará el interés por R de los que estáis iniciándoos en este software.
 
Curioso lo que comenta respecto al modelo desarrollado en China .
Esperemos que no lo exporten.
 
Si no habéis visto el primer video, podéis ver el post anterior:
o en el mismo Channel 9.
 
Animaros y a usar R.
 

2 feb 2018

RStudio Tips and Tricks

If you use R there are videos and tutorials which can help you to improve your work, so I will add some of them  in the blog, under the label VIDEO: R-Tutorials 

29 jul 2014

Comparing regressions with different scatter math-treatments (Shootout 2002 Tutorial)


In a previous post, we have developed the calibration without any math-treatment with the Training Set from Instrument 1, without any treatment , knowing that it was not the best choice, and we look to the LOO (leave one out) cross validation errors to check the performance.

Now we develop the regressions with some anti-scatter math-treatments to compare the cross validation errors and to decide which of them performs better. Anyway the shootout supplies also a test set, so validating with this test set will give us a better idea about how the calibration is performing with independent data.
 
First thing to do is to convert the “X1. Training” and “X1. Test” matrix to the math treatment we want to use: SNV (Standard Normal Variate), Detrend , SNV + Detrend and MSC.
>nir.train1_snv<-data.frame(X= I(X1_snv),Y=I(Y))
>nir.train1_detrend<-data.frame(X= I(t(X1_detrend)),Y=I(Y))
>nir.train1_snvdt<-data.frame(X= I(t(X1_snvdt)),Y=I(Y))
>nir.train1_msc<-data.frame(X= I(X1_msc),Y=I(Y))
Now we can develop the PLS regressions:
 
>mod1_snv<-plsr(Y~X,data=nir.train1_snv,+
 ncomp=10,validation="LOO")
>mod1_detrend<-plsr (Y~X,data=nir.train1_detrend,+
 ncomp=10,validation="LOO")
>mod1_snvdt<-plsr(Y~X,data=nir.train1_snvdt,+
 ncomp=10,validation="LOO")
>mod1_msc<-plsr(Y~X,data=nir.train1_msc,+
 ncomp=10,validation="LOO")
We can plot the RMSEP values versus the number of components (or terms), to have a better idea of the performance of the models (black line is the model without mat-treatments or raw spectra, green line is with just Detrend, the rest (SNV, SNV+DT and MSC) are almost overlaped.
 
But if we want to see it with more details, we have to see the numbers provided by the summary of the models. I mark in yellow the smallest values.
 
 
But the question can be: Do we have to choose the number of components which gives the small RMSEP?.
We will reply to this question soon.
In a next post we will do the same with derivative mixed with scatter corrections to see if we get better values for RMSEP and we will check it with an external validation (don´t forget that these RMSEP are for Cross Validation).