Icon

Bulding a decision tree - solution

Bulding a decision tree

This workflow guides you through building a decision tree model for predicting the income status in the adult dataset

1. Read the adult.csv file with the CSVReader node 2. Filter out the fnlwgt column with the Column Filternode and include only the rows with native-country =United-States with the Row Filter node 3. Partition the data into a training set(70%) and a test set (30%) with the Partitioning node. Use stratifiedsampling on the income column. 4. Train a decision tree on the training data withthe Decision Tree Learner node to predict theincome column. Apply it to the test set with theDecision Tree Predictor node. 5. Evaluate the prediction accuracywith the Scorer node This workflows shows the steps to build a classification model that predictsthe income (<50K / >=50K) in the adult dataset Read adult.csvExclude fnlwgtIncludeUnited States70/30on incomePredict income CSV Reader Column Filter Row Filter Partitioning DecisionTree Learner Decision TreePredictor Scorer 1. Read the adult.csv file with the CSVReader node 2. Filter out the fnlwgt column with the Column Filternode and include only the rows with native-country =United-States with the Row Filter node 3. Partition the data into a training set(70%) and a test set (30%) with thePartitioning node. Use stratifiedsampling on the income column. 4. Train a decision tree on the training data withthe Decision Tree Learner node to predict theincome column. Apply it to the test set with theDecision Tree Predictor node. 5. Evaluate the prediction accuracywith the Scorer node This workflows shows the steps to build a classification model that predictsthe income (<50K / >=50K) in the adult dataset Read adult.csvExclude fnlwgtIncludeUnited States70/30on incomePredict incomeCSV Reader Column Filter Row Filter Partitioning DecisionTree Learner Decision TreePredictor Scorer

Nodes

Extensions

Links