Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Exercises 1 to 4 , work with the adult _ ch 6 _ training and adult _ ch 6 _ test data sets. Use

For Exercises 1 to 4, work with the adult_ch6_training and adult_ch6_test data sets.
Use either Python to solve each problem. Import required packages as shown below
1. # import required packages
2. import os
3. import graphviz
4. import pandas as pd
5. import numpy as np
6. import statsmodels.tools.tools as stattools
7. from sklearn.tree import DecisionTreeClassifier, export_graphviz
8.
9. # read the csv adult_ch6_training data using the pandas package
10. adult_tr = pd.read_csv("/Users/markmaxwell/Desktop/Website Data Sets/adult_ch6_training
")
11.
12. # read the csv adult_ch6_test data using the pandas package
13. adult_test = pd.read_csv("/Users/markmaxwell/Desktop/Website Data Sets/adult_ch6_test")
1.
Create a CART model using the training data set that predicts income using marital status and capital
gains and losses. Visualize the decision tree (that is, provide the decision tree output). Describe the first
few splits in the decision tree.
2.
Develop a CART model using the test data set that utilizes the same target and predictor variables.
Visualize the decision tree. Compare the decision trees. Does the test data result match the training
data result?
3.
Use the training data set to build a C5.0 model to predict income using marital status and capital
gains and losses. Specify a minimum of 75 cases per terminal node. Visualize the decision tree.
Describe the first few splits in the decision tree.
4. How does your C5.0 model compare to the CART model? Describe the similarities and differences.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

ISBN: 1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

Write the difference between sexual and asexual reproduction.

Answered: 1 week ago

Question

What your favourite topic in mathematics?

Answered: 1 week ago