Icon

Ensemble_​Solution

Ensemble methods

Ensembles: binary classification of house ranking (high/low rank).

- Random forest
- Gradient Boosted Trees
- Training
- Evaluation
- Parameter Optimization

URL: Description of the Ames Iowa Housing Data https://rdrr.io/cran/AmesHousing/man/ames_raw.html
URL: Ames Housing Dataset on kaggle https://www.kaggle.com/prevek18/ames-housing-dataset
URL: Guide to Intelligent Data Science https://www.datascienceguide.org/

Exercise: Ensemble Models


The dataset we use in this exercise describes the sale of individual residential properties in Ames, Iowa from 2006 to 2010. One of the columns is the overall condition ranking, with values between 1 and 10. The goal of this exercise is to train a binary classification model, which can predict whether the overall condition is high or low. To do so, the workflow below reads the data set and creates the class column based on overall condition ranking, which is called rank and has the values low if the overall condition is smaller or equal to 5, otherwise high.
It is now on you continue this workflow!




  1. Train a random forest model (Random Forest Learner) to predict the overall condition of a house (high/low), with the following settings:

    • Limit tree depth to 15

    • Limit the minimum node size to 10

    • The number of trees (i.e. models) to 100

  2. Examine the output table “Attribute Statistics” generated by the learner node. It lists which features were chosen for the first 3 splits in different tree models. Features chosen first are likely informative in classification. Which of the features in this dataset are very informative? Justify your answer.

  3. Use the trained model to predict (Random Forest Predictor) the rank of the houses in the test set, and evaluate the accuracy of the decision tree model (Scorer JavaScript). What is the accuracy of the model?

  4. Train a gradient boosted trees model to predict the overall condition of a house (high/low), with the following setting:

    • Limit the tree depth to 4

    • The number of models to 100

  5. Use the trained model to predict the rank of the houses in the test set, and evaluate the accuracy of the decision tree model. What is the accuracy of the model?

  6. (Optional) Use a parameter optimization loop to find the optimum tree depth to maximize the accuracy (use Scorer node, not Scorer JavaScript). Examine the tree depth of 1 to 10, with the step size of 1. Which tree depth produces the optimal result?



Gradient Boosted Trees Learner
Gradient Boosted Trees Predictor
Scorer (JavaScript)
Parameter Optimization Loop End
Scorer
Parameter Optimization Loop Start
Random Forest Learner
Random Forest Predictor
Top: training data (70%) Bottom: testing data (30%)
Preprocessing
Read AmesHousing.csv
CSV Reader

Nodes

Extensions

Links