Skip to content

Implementing the same dataset with random forest and decision tree to see which works best.

License

Notifications You must be signed in to change notification settings

RamyaKoyaC/RandomForest-v-s-Decision-Trees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RandomForest-v-s-Decision-Trees

Implementing the same dataset with random forest and decision tree to see which works best.

library(rpart)
library(caret)
library(e1071)

We have now loaded the libraries

model_dt = train(Class ~ ., data = train_set, method = "rpart")
model_dt_1 = predict(model_dt, data = train_set)
table(model_dt_1, train_set$Class)
mean(model_dt_1 == train_set$Class)
model_dt_test = predict(model_dt, newdata = test_set)
table(model_dt_test, test_set$Class)
mean(model_dt_test == test_set$Class)

We have implemented a decision tree on test and train sets

About

Implementing the same dataset with random forest and decision tree to see which works best.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published