### CS 548 KNOWLEDGE DISCOVERY AND DATA MINING - Spring 2015 Project 2: Decision Trees, Linear Regression, Model Trees, Regression Trees

#### PROF. CAROLINA RUIZ

DUE DATE: Tuesday March 3rd, 2015.
• Slides: Submit by email to cs548-staff by 3:00 pm.
• Written report: Hand in a hardcopy by the beginning of class by 5:59 pm.

### Project Assignment:

1. Study Sections 4.1-4.5 and Appendix D of the textbook in great detail.

2. Study Witten's, Frank's, and Hall textbook (available on reserve in the WPI Library) Sect. 3.3, 4.6 (linear regression), and 6.6.

3. Study all the materials posted on the course Lecture Notes:
In particular, you should know the algorithms to construct decision trees, regression trees, and model trees very well, and be able to use these algorithms to construct trees from data by hand during the test. See examples provided in the Lecture Notes linked above. (Note: for model and regression trees, a software tool will be used to obtain the necessary linear regressions.)

4. THOROUGHLY READ AND FOLLOW THE PROJECT GUIDELINES. These guidelines contain detailed information about how to structure your project, and how to prepare your written summary, and how to study for the test.

*** You must use the Project 2 Template provided for your written report. *** (if you prefer not to use Word, you can copy and paste this format in a different editor as long as you respect the stated page structure and page limit.)

• Data Mining Technique(s): Run experiments in Weka AND in Python using the following techniques:

• Pre-processing Techniques: Feature selection, feature creation, dimensionality reduction, noise reduction, attribute discretization, ...

• Classification Techniques:
• Zero-R (majority class)
• One-R
• Decision trees: Using Weka (J4.8) and Python.
Since these decision tree implementations are able to handle numeric attributes and missing values directly, make sure to run some experiments with no pre-processing and some experiments with pre-processing (discretizing continuous attributes and replacing missing values before hand), and compare the results.

• Regression Techniques:
• Linear Regression: Weka (under "functions") and Python.
• Regression Trees: Weka (M5P under "trees") and Python.
• Model Trees: Weka (M5P under "trees") and Python.

• Dataset(s):

In this project, we will use the

Census-Income (KDD) Data Set
(use the census-income.data.gz data file with k-fold cross-validation,
so no need to use the census-income.test.gz data file).
This dataset is available at the

UCI Machine Learning Repository.

• For classification tasks: Pick either income (<\$50K or >\$50K) OR sex as the target attribute. Decide which of these two attributes would be a better target and use it for all your classificiation experiments.

• For regression tasks: Pick either weeks worked in year OR age as the regression target. Decide which of these two attributes would be a better target and use it for all your regression experiments.

Run experiments with and without discretizing the predicting attributes; removing attributes that are too related to the target (e.g., casual and registered when predicting cnt) or that make the trees too long; and with any other pre-processing and post-processing that produce useful and meaningful models.

• Performance Metric(s):
• Use the following metrics or evaluation methods:
1. For classification tasks: use classification accuracy, precision, recall, ROC Area, and confusion matrices.
For regression tasks: use correlation coefficient AND any subset of the following error metrics that you find appropriate: mean-squared error, root mean-squared error, mean absolute error, relative squared error, root relative squared error, and relative absolute error. An important part of the data mining evaluation in this project is to try to make sense of these performance metrics and to become familiar with them.
2. size of the tree,
3. readability of the tree, as separate measures to evaluate the "goodness" of your models, and
4. time it took to construct the tree.
• Compare each accuracy/error you obtained against those of benchmarking techniques as ZeroR and OneR over the same (sub-)set of data instances you used in the corresponding experiment.
• Remember to experiment with pruning of your tree: Experiment with pre- and/or post-prunning of the tree in order to increase the classification accuracy, reduce the prediction error, and/or reduce the size of the tree.

• Advanced Topic(s): Investigate in more depth (experimentally, theoretically, or both) a topic of your choice that is related to decision or model/regression trees and that was not covered already in this project, class lectures, or the textbook. This tree-related topic might be something that was described or mentioned briefly in the textbook or in class; comes from your own research; or is related to your interests. Just a few sample ideas are: The prune functions in Python; C4.5; C4.5 pruning methods (for trees or for rules); any of the additional tree classifiers in Weka: DecisionStump, LMT RandomForest, RandomTree, REPTree; meta-learning applied to decision trees (see Classifier -> Choose -> meta); other useful functionality in Python; an idea from a research paper that you find intriguing; or any other tree-related topic.