View on GitHub

Parameter-Tuning-Learners

Assignments, Projects and other course related material.

Back

HW 5

Description

Our contrast learner will examine each pair of nodes in the decision tree and report the delta and effect between each node in a pair

The delta is the difference in the branch path between each node
The effect is the mean difference in the performance score those nodes
Note that if the delta is:

positive then the contrast is a plan (something to do).
negative then the contrast is a monitor (something to watch for).
Note also that is statistically there is no difference between the population of instances in each node, then there is no point printing that contrast. For code to conduct those statistical tests, see same in num.

Test: Using auto.csv, print the plans and monitors separately. Note that for the leaves with best scores, there should be no plans generated. Similarly, for the leaves with worst scores, there should be monitors generated.

Source Files

All source files are present in ./src/ directory

Contrasts.py

Setup

Code has been tested on Python 2.7.12
If uses files from previous homeworks (1, 2, 3, 4)

Usage

To run the code,

python src/Contrasts.py data/auto.csv

Note: For updating any parameters for the trees or statistical tests, please take a look at the ../HW1/Config.py. It defines the various parameters used by various parts of the code.
The nomenclature of such parameters has been kept same as the original lua code.

Replace the path of the test file as requried
It uses some source files from HW1, HW2, HW3 and HW4. Those paths have been included wherever required
To ensure that it always runs, please run it from this (/HW5/) directory (using the same command above)

References

More details about the instructions can be found at Homeworks