I am trying to perform forward regression based on different classifications that I have in my csv. Is there any possible way to do it? As it's not a linear model I can't just use the lm() function.
I had done many research, but those do not show me how to fit a classification model inside.
This is my code trying to build a classification model:
XBC <- read.csv("C:/Users/SFASi/Desktop/Fusarium Project September/XBC2/XBC(Raw) - Copy.csv")
XBC <- XBC[ -c(1:3) ]
glimpse(XBC)
names <- c(1,2,5,6,8,10)
XBC[,names] <- lapply(XBC[,names],factor)
glimpse(XBC)
set.seed(100)
library(caTools)
spl = sample.split(XBC$Treatment, SplitRatio = 0.7)
train = subset(XBC, spl == TRUE)
test = subset(XBC, spl == FALSE)
print(dim(train));print(dim(test))
model_glm = glm(Treatment~., data = train)
summary(model_glm)