Task 2: Machine Learning automatic resolution
Izpildes nosacījumi
Skatīt
Use some R packages for machine learning to predict SDG indicators
4. Task 4
4.1. Task 4.1: Decision Trees
Documentation: randomForest function - RDocumentation
Action: | Expected: |
> install.packages('randomForest') | ![]() |
|---|
Action: | Expected: |
| > # ensure that the data is discrete (c.c. are considered linear)
> for(i in 2:6) data[,i]<-factor(data[,i])
> test <- randomForest(x=data[,2:5], y=data[,6], ntree=1, importance=TRUE)
> print(test)
> getTree(test, 1) # shows tree information, must be drawn
> test$type # confirm that it was a classification and not a regression
> predict(test, data[,2:5]) | ![]() |
|---|
Action: repeat with training and test sets

