Decision Tree Classification
In this exercise, you will use the RStudio interface to run the conditional inference tree (ctree) algorithm for classification. You will run the method on a training data to build the model and will evaluate the model on a test data.
![1612_figure.jpg](https://secure.tutorsglobe.com/CMSImages/1612_figure.jpg)
Exercise Instructions
Part 2 - Run an exercise on theCredit Approval dataset and write a report on your findings. The report needs to cover the exercise key points below in order and in your own words.
1. Introduction
- Identify the dependent variable in the Credit Approval dataset.
- Identify the independent variables in the Credit Approval dataset.
- What do you expect the ctree method to accomplish for the Credit Approval data?
2. Data Pre-processing. Load the data into R studio, and discuss the data preprocessing steps (if any) you run before splitting the data into training and test set. For each step, include the command you ran, the output, and an explanation of what the step accomplishes.
3. Training and test data
- Why do we split the dataset into training and test data?
- Run the set.seed(1234) command and the commands to split the data into training set containing 70% of instances and test set containing the remaining 30% of instances. Include the commands in the report.
4. Build the ctree model on training data
- Run the command to build the ctree model. Store the model in a variable called model. Include the command in the report, and discuss the input parameters you used.
- Run the print(model) command to output the model we built in the textual format. Include the command and the output in the report.
- Interpret the textual structure of the model, including the nodes splitting, and the leaf nodes.
- Which independent variables could be the significant predictors of the dependent variable in your data? Why?
5. Visualize the tree - run the plot(model) command to build the tree plot. Include the command, the plot, and the interpretation of the tree structure in the report.
6. Confusion matrix
- Build the confusion matrix for the training data. Include the command and the matrix in the report.
- What is the classification accuracy for the training data?
- Besides classification accuracy, what additional information does the confusion matrix provide?
7. Evaluate the model on test data
- Build the confusion matrix for the test data and. Include the command and matrix in the report
- What is the classification accuracy for the test data?
- How does the classification accuracy for the test data compare to the classification accuracy for the training data?
8. New instance - Suppose that you have a new Credit Card application record, and the value of the dependent variable is unknown. How would you use the ctree model to classify that record?
9. Summary
- What differences between the Apriori and ctree methods did you observe?
- Do the missing values affect the ctree results?
- Which part of this exercise did you find the most challenging, and what steps you took to resolve the challenge?
Exercise Deliverables
Submit the following files in the Exercise 5 Assignment folder.
- The report addressing the key points above
- An R script with commands your ran and brief comments on the commands purpose
Attachment:- CreditApproval.csv