There are many potential uses for decision trees, but they are most useful when there are several possible variables and you're interested in the reasoning process. In some cases, you already know the outcomes, and the interesting part is modeling the outcomes to understand why they are as they are. One area in which this is potentially very interesting is understanding prices of goods, particularly those that have a lot of variability in measurable ways. This section will look at building decision trees for modeling real estate prices, because houses vary greatly in price and have many numerical and nominal variables that are easily measured.
Zillow is a free web service that tracks real estate prices and uses this information to create price estimates for other houses. It works by looking at comps (similar houses) and using their values to predict a new value, which is similar to what real estate appraisers do. A section of a Zillow web page showing information about a house and its estimate value is shown in Figure 7-5.
Figure 7-5. Screenshot from zillow.com
Fortunately, Zillow also has an API that lets you get details and the estimated value of houses. The page for the Zillow API is http://www.zillow.com/howto/api/APIOverview.htm.
You'll need to get a developer key to access the API, which is free and available from the web site. The API itself is ...