Question: Q2 c (c) An incomplete Python program is shown in Program Listing Q2(c) below. from pandas import read_csv from sklearn.tree import Decision TreeClassifier from sklearn.model_selection
Q2 c

(c) An incomplete Python program is shown in Program Listing Q2(c) below. from pandas import read_csv from sklearn.tree import Decision TreeClassifier from sklearn.model_selection import train_test_split as split df = read_csv ("dataset.csv") dataset = df.values X = dataset[:,:4] y = dataset[:,4] x_train, x_test, y_train, y_test = split(x, y, test_size=0.25) Program Listing Q2(c) i. Determine how many data samples are used for training and testing respectively, if there are 300 data samples in the dataset. [3 marks] ii. Complete the Python program to build a decision tree model for classification using the training samples and print out its performance when evaluated using the testing samples. Assume that all default settings are used in training the model. [4 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
