get_predictions_lin {CARRoT} | R Documentation |
Function which runs a linear regression on a training set, computes predictions for the test set
get_predictions_lin(trset,testset,outc,k)
trset |
values of predictors on the training set |
testset |
values of predictors on the test set |
outc |
values of predictors on the training set |
k |
length of the test set |
An array of continous variables of the length equal to the size of a testset
Function uses function lsfit
and coef
trset<-matrix(c(rnorm(90,2,4),runif(90,0,0.5),rbinom(90,1,0.5)),ncol=3) testset<-matrix(c(rnorm(10,2,4),runif(10,0,0.5),rbinom(10,1,0.5)),ncol=3) get_predictions_lin(trset,testset,runif(90,0,1),10)