A rule-based baseline produces predictions from explicit conditions or category-specific statistics instead of learned general-purpose parameters. It is a practical step between a constant baseline and a linear model. section 8.3
Common forms include:
- Return a fixed value when a condition matches, such as “if district == X: return Y.” section 8.3
- Return the mean, median, or mode for one category or a combination of categories. section 8.3
- Use regular expressions as an initial rule-based approach for natural language processing problems. section 8.3
Taxi arrival-time prediction
For a taxi aggregator, predicting five minutes for every request or four minutes for Manhattan created simple comparison points. A location-based median could provide a more specific rule, and the rule-based fallback was difficult to beat with more sophisticated machine learning. section 8.3
Figure 8.3 A typical sequence of baselines at the early stage of designing your model
Use the baseline sequence to place rule-based models between constant baselines and linear models before considering more specialized approaches. section 8.3
