I’m using the r-package pls, and I want to use the Partial Least Squares method to create a prediction of my data. The input I’m using is land cover percentage (bare soil cover-%, “soil”) as the predictor variable, and its spectra as the response variable (“train”, a 70 % subset of my whole data). The rest of the dataset in a subset called “test”.
The cover percentage in “train” is always within 0 and 100, but the prediction is sometimes less than 0.
Is there a way to preset the model so, that it can only give predictions between 0 and 100?
My code:
model <- plsr(soil ~ ., data=train, scale=F, validation=”CV”)
plsr_pred <- predict(model,test,ncomp=3)
I’ve tried to delve into the package’s manual, but keep coming up empty.
Salla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.