University of Wisconsin Computer Sciences Header Map (repeated with 
textual links if page includes departmental footer) Useful Resources Research at UW-Madison CS Dept UW-Madison CS Undergraduate Program UW-Madison CS Graduate Program UW-Madison CS People Useful Information Current Seminars in the CS Department Search Our Site UW-Madison CS Computer Systems Laboratory UW-Madison Computer Sciences Department Home Page UW-Madison Home Page

Handling Continuous Features in HW 2

Here's an inefficient but easy way to handle continuous features in ID3:

You really should do the above on each recursive call of ID3, but if that is too complicated doing the above "brute force" method is ok (I think both methods will pick the same thresholds, possibly modulo tie-breaking).

For the "random" splitting function, treat a continuous feature as a single feature in terms of its chances of being picked. If picked, be sure to select a threshold for which there are examples on both sides of the threshold (to prevent infinite loops). Give all such thresholds (i.e., those the split the difference between the values for trainset examples, regardless of category of the example since this is supposed to be random) an equal chance of being selected.