library("Boruta")
## Warning: package 'Boruta' was built under R version 3.4.2
## Loading required package: ranger
## Warning: package 'ranger' was built under R version 3.4.2
library("mlbench")
data("Ozone")
Ozone <- na.omit(Ozone)
set.seed(123)
Boruta.Ozone <- Boruta(V4 ~ ., data = Ozone, doTrace = 2, ntree = 500)
## 1. run of importance source...
## 2. run of importance source...
## 3. run of importance source...
## 4. run of importance source...
## 5. run of importance source...
## 6. run of importance source...
## 7. run of importance source...
## 8. run of importance source...
## 9. run of importance source...
## 10. run of importance source...
## 11. run of importance source...
## After 11 iterations, +2.3 secs:
## confirmed 9 attributes: V1, V10, V11, V12, V13 and 4 more;
## rejected 1 attribute: V3;
## still have 2 attributes left.
## 12. run of importance source...
## 13. run of importance source...
## 14. run of importance source...
## 15. run of importance source...
## 16. run of importance source...
## 17. run of importance source...
## 18. run of importance source...
## 19. run of importance source...
## 20. run of importance source...
## 21. run of importance source...
## 22. run of importance source...
## 23. run of importance source...
## 24. run of importance source...
## 25. run of importance source...
## 26. run of importance source...
## 27. run of importance source...
## After 27 iterations, +4.5 secs:
## rejected 1 attribute: V2;
## still have 1 attribute left.
## 28. run of importance source...
## 29. run of importance source...
## 30. run of importance source...
## 31. run of importance source...
## 32. run of importance source...
## 33. run of importance source...
## After 33 iterations, +5.2 secs:
## rejected 1 attribute: V6;
## no more attributes left.
Boruta.Ozone
## Boruta performed 33 iterations in 5.245702 secs.
## 9 attributes confirmed important: V1, V10, V11, V12, V13 and 4
## more;
## 3 attributes confirmed unimportant: V2, V3, V6;
plot(Boruta.Ozone)

set.seed(123)
Boruta.Short <- Boruta(V4 ~ ., data = Ozone, maxRuns = 12)
Boruta.Short
## Boruta performed 11 iterations in 1.477044 secs.
## 9 attributes confirmed important: V1, V10, V11, V12, V13 and 4
## more;
## 1 attributes confirmed unimportant: V3;
## 2 tentative attributes left: V2, V6;
TentativeRoughFix(Boruta.Short)
## Boruta performed 11 iterations in 1.477044 secs.
## Tentatives roughfixed over the last 11 iterations.
## 10 attributes confirmed important: V1, V10, V11, V12, V13 and 5
## more;
## 2 attributes confirmed unimportant: V2, V3;
getConfirmedFormula(Boruta.Ozone)
## V4 ~ V1 + V5 + V7 + V8 + V9 + V10 + V11 + V12 + V13
## <environment: 0x0000000010985568>
attStats(Boruta.Ozone)
## meanImp medianImp minImp maxImp normHits decision
## V1 9.437168 9.4793429 7.4101995 10.8039589 1.0000000 Confirmed
## V2 1.055955 0.9883898 -0.4952651 3.4238916 0.1515152 Rejected
## V3 -1.290509 -1.2293862 -2.8873974 -0.5172981 0.0000000 Rejected
## V5 9.044032 9.0533499 7.2423170 10.4179080 1.0000000 Confirmed
## V6 1.335173 1.5187136 -1.7885085 2.6797182 0.2121212 Rejected
## V7 11.692862 11.5895736 10.1230176 13.4199106 1.0000000 Confirmed
## V8 17.045620 17.0142307 15.4155537 18.8382758 1.0000000 Confirmed
## V9 19.280470 19.2410564 18.4844237 20.1630623 1.0000000 Confirmed
## V10 9.969442 9.9158170 8.9604958 11.2115556 1.0000000 Confirmed
## V11 12.106364 12.0399115 10.5887459 13.6088806 1.0000000 Confirmed
## V12 14.745610 14.7786519 12.9632734 16.2185406 1.0000000 Confirmed
## V13 9.358977 9.3236440 8.1211435 11.0248438 1.0000000 Confirmed