See more:
(untagged)
I am trying out on how to predict results on R, however when I try to run the code, R says that object "Survived" is not found, may I know what can I do ?
What I have tried:
# Converting 'Survived' to a factor
train$Survived <- factor(train$Survived)
# Set a random seed
set.seed(51)
# Training using 'random forest' algorithm
model <- (train$Survived ~ Pclass + Sex + SibSp + Embarked + Parch + Fare,
date = train,
method = 'rf',
trControl = trainControl(method = 'cv',number = 5)