4 nov 2021

Practicing with soil own data and Resemble (I)

Along these days I am posting with Resemble following the vignette: Modelling complex spectral data with the resemble package (Leonardo Ramirez-Lopez and Alexandre M.J.-C. Wadoux) , (still more posts are coming), but it is time to check it with my own soil data.

I have imported a soil data set and split it into a training and a test set. I apply the Savitzky Golay first derivative:

Now I run the orthogonal principal component analysis, trying to find the optimal selection of the number of components for the Clay parameter.

optimal_sel <-  list(method = "opc", value = 40)
pca_training_opc <- ortho_projection(Xr = training$spc_nir_p,
                               Yr = training$Clay,
                               method = "pca", 
                               pc_selection = optimal_sel)
pca_training_opc
plot(pca_training_opc, col = "#FF1A00CC")

19 PC terms are chosen, that if you remember is the value which give the smallest RMSD between the clay lab value of every sample and the clay lab value of its closest neighbor. The figures show the election of the 19 terms and the XY plot where the RMSD is calculated for the training samples.


Finally I show you the texture triangle for the samples I am using (whole data set). I publish in a recent post a Youtube video from ISRIC where it shows how to obtain it with R.


No hay comentarios:

Publicar un comentario