Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900