Looking to the spectra of the previous post was clear
that we must apply a pre-treatment to remove the baselines shifts. One way to
do it is to treat every spectrum individually, calculating a linear model
(absorbance values vs. wavelengths) and getting the values of the slope at
every wavelength, after these values are subtracted from the absorption values
of the spectrum getting the baseline corrected spectrum. We repeat the process
for every spectrum.
This function is available in the package pracma, and
its name is detrend. In case we use it for the spectra pre-process in Caret
with “center” and “scale”, we change the view from this:
To this:
This way we can see more clearly the variation in the
spectra that we can try to interpret some way. Also, with this new pre-treatment
we can check if the PCA change some way, and better to find outliers.
One of the options for interpretation are the
correlation spectrum (see the correlation of every wavelength with the
parameter of interest). In this case we can see how fat is inverse
correlated with protein and moisture, and there are some positive correlations
between protein and moisture.
We can see this if we run the correlation plot for the parameters;
No hay comentarios:
Publicar un comentario