I have been building a couple different regression models using the caret package in R in order to make predictions about how fluorescent certain genetic sequences will become under certain experimental conditions. I am using a few different linear model building methods for regression, and will use
postResamples in order to compare the Rsquared and RMSE of one model with other models.
However, under my current set up, I have been unable to get an Rsquared value that is higher than 0.40, in either my testing set or training set of my data. Given that I must apply these models to other data sets in the future in order to make predictions about their fluorescence score, I am not sure what I can do in order to increase the Rsquared (or decrease the RMSE). I have tried researching which different resampling methods might improve the fit, but a lot of the tutorials online seems to be geared towards improving the fit of classification and not regression models.
So what can I do in terms of modifying the
traincontrol object or using a different method that may improve the quality of my fit?
I should also mention, each of the predictors is either an integer or a float, and some have ranges that may not be normally distributed.
Here is the code I thus far been using. The resampling method I have been using is assigned to the
CvCtrl train control object:
library(caret) data <- read.table("mydata.csv") sorted_Data<- data[order(data$fluorescence, decreasing= TRUE),] splitprob <- 0.8 traintestindex <- createDataPartition(sorted_Data$fluorescence, p=splitprob, list=F) holdoutset <- sorted_Data[-traintestindex,] trainingset <- sorted_Data[traintestindex,] traindata<- trainingset[c('x1', 'x2', 'x3', 'x4', 'x5', 'fluorescence')] cvCtrl <- trainControl(method = "repeatedcv", number= 20, repeats = 20, verboseIter = FALSE) modelglmStepAIC <- train(fluorescence~., traindata, method = "glmStepAIC", preProc = c("center","scale"), trControl = cvCtrl) model_rlm <- train(fluorescence~., traindata, method = "rlm", preProc = c("center","scale"), trControl = cvCtrl) pred_glmStepAIC<- predict.lm(modelglmStepAIC$finalModel, holdoutset) pred_rlm<- predict.lm(model_rlm$finalModel, holdoutset) glmStepAIC_summary<- postResample(pred_glmStepAIC, holdoutset$logfl) rlm_summary<- postResample(pred_rlm, holdoutset$logfl)