I am trying to use various prediction algorithms from the Caret package in R for regression problem that is my target variable is continuous. Caret thinks classification is the appropriate class of the problem and when I pass any of the regression models, I get an error message that says "wrong model type for classification". For reproducibility, let's see with the Combined Cycle Power Plant Data Set. The data is in CCPP.zip. Let's predict power as a function of the other variables. Power is a continuous variable.
library(readxl)
library(caret)
power_plant = read_excel("Folds5x2_pp.xlsx")
apply(power_plant,2, class) # shows all columns are numeric
control <- trainControl(method="repeatedcv", number=10, repeats=5)
my_glm <- train(power_plant[,1:4], power_plant[,5],
method = "lm",
preProc = c("center", "scale"),
trControl = control)
The image below is my screenshot: