29 feb. 2016

Tutorials with Resemble (Part 2)

In the first post of the Resemble tutorials we get with this function:
ex1 <- mbl(Yr = Y_train, Xr = X_train, Yu = NULL, Xu = X_val,
           mblCtrl = ctrl,
           distUsage = "predictors",
           k = seq(30, 150, 15),
           method = "wapls1",
           pls.c = c(7, 20))

the predictions for every spectra in the NIRsoil validation set. 
Now we can use the function "plot.mbl":
plot(x, g = c("validation", "pca"), param = "rmse", pcs = c(1,2), ..)
to look to some interesting plots that help us to understand better the performance of the different models:
The first plot shows the errors (RMSE) with the different configurations of neighbors:

As we can see with 120 we have the lowest error.
The next plot shows the Score plot  (PC1 vs PC2) with the training samples (Xr) in one color and the validation samples (Xu) in a different color.
We can configure the function to plot different maps of scores changing in "pcs" the numbers.
We can see with also the correlation plot, changing the param for "r2" indeed "rmse".




No hay comentarios:

Publicar un comentario