Icon

18_​Decision_​Tree - Solution

18_Decision_Tree - Solution
Exercise Decision Tree1) Read data adult.csv2) Train a Decision Tree to predict whether or not a person earns more than 50k per year- Partition the dataset into a training set (75%) and a test set (25%). Apply stratified sampling option on the income column.- Train a Decision Tree model on the training set, and apply the model to the test setOPTIONAL: - Use the Scorer node to evaluate the accuracy of the model- Try out other parameter settings to get a higher accuracy. For example, change the quality measure, pruning method, orminimum number of records. Read dataadult.csvTop: train set (75%)Bottom: test set (25%)Stratified sampling on incomeTrain the modelto predict people incomeApply the modelto the test setEvaluate model accuracy File Reader Partitioning DecisionTree Learner Decision TreePredictor Scorer Exercise Decision Tree1) Read data adult.csv2) Train a Decision Tree to predict whether or not a person earns more than 50k per year- Partition the dataset into a training set (75%) and a test set (25%). Apply stratified sampling option on the income column.- Train a Decision Tree model on the training set, and apply the model to the test setOPTIONAL: - Use the Scorer node to evaluate the accuracy of the model- Try out other parameter settings to get a higher accuracy. For example, change the quality measure, pruning method, orminimum number of records. Read dataadult.csvTop: train set (75%)Bottom: test set (25%)Stratified sampling on incomeTrain the modelto predict people incomeApply the modelto the test setEvaluate model accuracyFile Reader Partitioning DecisionTree Learner Decision TreePredictor Scorer

Nodes

Extensions

Links