Advertisement
CastelShal

Randomforest

Sep 26th, 2024
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.17 KB | None | 0 0
  1. library(caret)
  2. library(randomForest)
  3.  
  4. model = randomForest(Species~.,data=iris, ntree=100, mtry=2)
  5. pred = predict(model, iris)
  6.  
  7. confusionMatrix(pred, iris$Species)
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement