Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.4 Model Selection Classes

As described in detail in Section 4.2, model selection is best viewed as searching the space of predictor variable subsets. The difference among the techniques provided in Analytics.h++ involves the choice of a starting subset and the specification of neighboring subsets in the search space.

The classes that implement the various search algorithms are all derived from the abstract base class RWModelSelector<T,S,F,>. The first template parameter is the type for the predictor data, and the second is the type for the observation data. The third template parameter, F, is a function object that evaluates a given regression model.

Classes deriving from RWModelSelector, when given a particular predictor variable subset, must provide a list of neighboring predictor variable subsets. This is accomplished by overriding the pure virtual function neighborIterator() in the base class. This method takes as an argument a predictor variable subset in the form of a bit vector, and returns an instance of the class RWNeighborIterator. The ith element of the vector used as an argument is on if the predictor variable is in the subset, and off if it is not.

RWNeighborIterator is a handle class; that is, it provides a standard interface whose methods are carried out by a body class, as in the standard handle-body design pattern. Thus, objects that implement the neighborIterator method construct an implementation for the RWNeighborIterator class, wrap it in an RWNeighborIterator body, and return it. The base class, RWModelSelector, then uses it to perform the search.

Two classes, RWLinRegModelSelector and RWLogRegModelSelector, provide a high-level interface to classes derived from RWModelSelector. The hierarchy for the model selection classes appears in Figure 3.

Figure 3 -- Model Selection Class Hierarchy



Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.