Feature Engineering for Actuarial Predictive Models
Learn feature engineering techniques for improving actuarial models on Exam SRM.
What Is Feature Engineering?
Feature engineering is the process of creating, transforming, or selecting input variables (features) to improve model performance. In actuarial modeling, raw data often needs transformation before it can be effectively used. Good features can dramatically improve prediction accuracy, sometimes more than the choice of algorithm.
Feature engineering requires domain knowledge about insurance, risk factors, and policyholder behavior. A data scientist without insurance knowledge might overlook important derived variables, while an actuary who understands the business can create features that capture meaningful risk distinctions. The combination of statistical skill and domain expertise is what makes feature engineering effective.
The process is iterative: hypothesize a feature, create it, evaluate its impact on model performance (using cross-validation or holdout data), and refine or discard it based on results. Not every engineered feature will improve the model, and some may introduce noise or overfitting.
Mathematical Transformations
Log transformation is applied to right-skewed variables like claim amounts, income, or building values. It compresses the range of large values, stabilizes variance, and often makes relationships more linear. In actuarial data, claim severity distributions are almost always right-skewed, making log transformation a standard preprocessing step.
Square root transformation is gentler than log and handles zero values naturally (log(0) is undefined). Box-Cox transformation generalizes both: Y_transformed = (Y^lambda - 1)/lambda, where lambda is chosen to maximize normality. When lambda = 0, it reduces to the log transform; when lambda = 0.5, it is close to the square root.
Polynomial features (X^2, X^3) and interaction terms (X1*X2) capture non-linear relationships within linear models. Adding age^2 to an auto insurance model allows the relationship between age and risk to be U-shaped (high risk for very young and very old drivers) rather than strictly linear. Interaction terms capture synergies between variables, such as the interaction between driver age and vehicle horsepower.
Binning and Discretization
Binning converts continuous variables into categories. Equal-width binning divides the range into bins of equal size; equal-frequency (quantile) binning divides observations into bins with equal counts. Custom binning uses domain knowledge to define meaningful boundaries, such as age groups that correspond to known risk transitions.
Binning offers several advantages: it captures non-monotonic effects, reduces the impact of outliers, handles non-linear relationships without requiring the correct functional form, and produces more interpretable models. However, it loses information within each bin and requires choosing the number and boundaries of bins, which are somewhat arbitrary decisions.
In actuarial ratemaking, continuous rating variables are often grouped into a moderate number of classes (e.g., 5 to 10 age groups rather than individual ages). This reflects both practical considerations (filing and implementation simplicity) and statistical concerns (stability of estimates in each group).
Date and Time Features
Date fields contain rich information that raw date values do not capture directly. Useful derived features include: year, month, day of week, quarter, and indicators for holidays or weekends. In insurance, policy duration (time since inception), time since last claim, and seasonality of claims are important features.
Cyclical features like month or day of week should be encoded carefully. Simple integer encoding (January = 1, December = 12) implies that December is far from January, when in reality they are adjacent. Sine and cosine encoding (sin(2*pi*month/12) and cos(2*pi*month/12)) preserves the cyclical nature. This is particularly relevant for modeling seasonal patterns in claim frequency.
Trend features capture changes over time. A linear time trend, year-over-year growth rates, or moving averages can capture inflation, regulatory changes, or shifts in the underlying risk population.
Domain-Specific Actuarial Features
Actuarial feature engineering leverages insurance-specific knowledge. Common derived features include: loss ratio (incurred losses / earned premium), claim frequency (number of claims / exposure in policy years), average severity (total losses / number of claims), and combined ratio (loss ratio + expense ratio). These aggregate measures summarize the performance of a block of business.
Territory-based variables aggregate information at the geographic level: population density, median income, crime rate, weather patterns, and distance to emergency services. These can be more predictive than individual policyholder characteristics for certain perils. Spatial smoothing techniques (credibility weighting, Gaussian process models) help stabilize territory estimates in areas with sparse data.
Relativities from existing rating plans can serve as features in updated models. If the current rating plan assigns a relativity of 1.35 to a particular vehicle class, that relativity captures the accumulated underwriting knowledge about that class and can be a powerful predictor in a new model.
Feature Scaling and Normalization
Many algorithms (SVMs, neural networks, k-nearest neighbors, regularized regression) are sensitive to the scale of features. Standardization (subtracting the mean and dividing by the standard deviation) produces features with mean 0 and variance 1. Min-max normalization scales features to a fixed range, typically [0, 1].
Tree-based methods (decision trees, random forests, gradient boosting) are invariant to monotone transformations and do not require scaling. This is one of their practical advantages. However, if you plan to compare feature importance across differently scaled variables, standardization can make the comparisons more meaningful.
Always fit the scaling parameters on the training data only, then apply the same transformation to the test data. Fitting scaling parameters on the entire dataset (including test data) constitutes data leakage and produces overly optimistic performance estimates.
Study Tips and Common Pitfalls
The most common pitfall in feature engineering is data leakage: using information from the target variable or future data to construct features. Target encoding without proper cross-validation, including future claim information in features for predicting past events, or scaling using the full dataset are all forms of leakage. Leakage makes models appear better than they truly are.
On Exam SRM, understand the purpose and mechanics of each transformation type. Know when to use log vs. polynomial vs. binning. Be able to explain why domain-specific features are valuable and how they improve predictive power. Practice identifying potential data leakage in feature construction scenarios. These conceptual questions are common on the exam.