search for: lmtrain

Displaying 1 result from an estimated 1 matches for "lmtrain".

Did you mean: lmain
2010 Jul 16
3
Help with Sink Function
...le, miceTestSample) table(miceTestSample$pID50, fit.kknn$fit) (fit.train1 <- train.kknn(pID50~., miceTrainSample, kmax=15, kernel=c("rectangular"), distance=1)) predictedTrain <- predict(fit.train1, miceTrainSample, miceTrainSample$pID50) pID50Train <- miceTrainSample$pID50 lmTrain <- lm(predictedTrain~pID50Train) slm <- summary(lmTrain) str(slm) if (i == 1) { previousR2 <-slm$r.squared sink(file="R2outputKKNN.txt", append=TRUE) previousR2 sink() } else if(i!=1) { currentR2 <- slm$r.squared if (previousR2 > currentR2) {...