Icon

Solution 1 Training the Decision Tree Algorithm

This workflow shows a solution to a hands-on exercise in the L4-ML Introduction to Machine Learning Algorithms self-paced course

Task 2: Check the tree structure in the decision tree view1. Train a decision tree on all data using "class" as the targetcolumn2. Check the decision tree view3. Train another decision tree but this time uncheck the box"Average split point" Task 3: Train and evaluate the same decision tree with 2 different splitting criteria (Giniindex & gain ratio)1. Partition the data into training and test sets using 70/30 split and stratified sampling onthe "class" column2. Train a decision tree on the training set to predict the "class" column. Use the defaultconfiguration.3. Apply the model to the test set4. Evaluate the model's performance.5. Change the quality measure to Gain ratio and retrain the decision tree model. Task 1: Compare the features' class separation1. Color the rows by the "class" column2. Visualize the following features in a scatter plot: - feature 0 vs feature 1- feature 3 vs feature 1 color by classCheck class separation(with a redundant feature)Check class separation(relevant features)v1(average split point)split intotraining and testv2(largest value of lower partition)v1(Gini Index)v2(Gain Ratio)Readdec-tree-data.table Color Manager Scatter Plot Scatter Plot DecisionTree Learner Partitioning DecisionTree Learner DecisionTree Learner Decision TreePredictor Scorer DecisionTree Learner Decision TreePredictor Scorer Table Reader Task 2: Check the tree structure in the decision tree view1. Train a decision tree on all data using "class" as the targetcolumn2. Check the decision tree view3. Train another decision tree but this time uncheck the box"Average split point" Task 3: Train and evaluate the same decision tree with 2 different splitting criteria (Giniindex & gain ratio)1. Partition the data into training and test sets using 70/30 split and stratified sampling onthe "class" column2. Train a decision tree on the training set to predict the "class" column. Use the defaultconfiguration.3. Apply the model to the test set4. Evaluate the model's performance.5. Change the quality measure to Gain ratio and retrain the decision tree model. Task 1: Compare the features' class separation1. Color the rows by the "class" column2. Visualize the following features in a scatter plot: - feature 0 vs feature 1- feature 3 vs feature 1 color by classCheck class separation(with a redundant feature)Check class separation(relevant features)v1(average split point)split intotraining and testv2(largest value of lower partition)v1(Gini Index)v2(Gain Ratio)Readdec-tree-data.tableColor Manager Scatter Plot Scatter Plot DecisionTree Learner Partitioning DecisionTree Learner DecisionTree Learner Decision TreePredictor Scorer DecisionTree Learner Decision TreePredictor Scorer Table Reader

Nodes

Extensions

Links