2019-12-20

data<-read.csv("C:/Users/ZWPC/Desktop/pls.csv",header=F)
pls <- plsr(V1~.,data=data,30,validation="CV")#全波段最小二乘法
selectNcomp(pls,plot=T)
cor(data$V1,pls$fitted.values[,,10])^2
summary(pls)#查看
plot(data$V1,pls$fitted.values[,,10])
write.csv(data,"C:/Users/ZWPC/Desktop/pls1.csv",row.names=F)

你可能感兴趣的:(2019-12-20)