← back to blog

Feature Engineering for Price Modelling

How data transformations improve model performance and define risk constraints

Chaïmae SritiJune 2025

1. Introduction

Raw data rarely arrives in a form that statistical models can use effectively. Feature engineering transforms raw observations into signals that expose the underlying patterns we care about—risk drivers, behavior shifts, and predictive relationships that directly inform pricing decisions.

In insurance pricing, feature engineering serves two critical purposes: it improves predictive accuracy by capturing non-linear relationships and interactions, and it encodes domain expertise by translating actuarial intuition into model constraints that regulators and stakeholders can understand and trust.

Key insight: The best feature engineering doesn't just improve metrics—it makes models interpretable, aligns them with business logic, and ensures they're robust enough to pass regulatory scrutiny.

2. Key Data Transformations

Binning: Discretizing Continuous Variables

Binning converts continuous variables into discrete categories, which helps models capture non-linear relationships while maintaining interpretability. In insurance, this is essential for features like driver age, vehicle age, or credit score.

Example: Driver Age
Age Range
Risk Profile
16-25
High risk (inexperience)
26-40
Moderate risk
41-65
Low risk (experience)
66+
Increasing risk (reaction time)

Why it works: Binning allows the model to learn that risk doesn't increase linearly with age. Young drivers and elderly drivers both carry higher risk, but for different reasons. The model can assign appropriate coefficients to each bin without forcing a monotonic relationship.

Capping: Handling Outliers and Extreme Values

Capping limits extreme values to prevent outliers from distorting model coefficients. This is particularly important for features like vehicle value, mileage, or claim history where a small number of extreme cases could skew predictions for the entire portfolio.

Example: Vehicle Value
• Cap at 95th percentile: $85,000
• All vehicles valued above $85,000 are treated as $85,000
• Prevents luxury/exotic cars from dominating the model
• Maintains stable predictions for the majority of the portfolio

Why it works: Without capping, a few ultra-expensive vehicles could force the model to overweight the vehicle value coefficient, leading to poor predictions for the bulk of the portfolio. Capping ensures the model learns robust patterns that generalize well.

Grouping Categories: Reducing Dimensionality

When categorical features have many levels, grouping similar categories reduces noise and improves statistical power. This is common for features like vehicle make/model, occupation codes, or geographic territories.

Example: Vehicle Make Grouping
Before: 150+ individual makes (BMW, Mercedes, Audi, Lexus, ...)
After grouping:
• Luxury: BMW, Mercedes, Audi, Lexus, Porsche
• Economy: Honda, Toyota, Hyundai, Kia
• Truck: Ford F-Series, Chevy Silverado, Ram
• Sports: Corvette, Mustang, Challenger

Why it works: Grouping reduces the degrees of freedom in the model, which improves stability and reduces overfitting. It also encodes domain knowledge—luxury brands tend to have similar risk profiles regardless of the specific manufacturer.

Transformations: Log, Square Root, and Power Transforms

Mathematical transformations can linearize non-linear relationships, stabilize variance, and make distributions more suitable for modeling. This is especially useful for highly skewed features like claim amounts or exposure measures.

Common Transformations
Log transform: log(claim_amount + 1) — stabilizes variance for claim severity
Square root: √(mileage) — reduces impact of extreme high-mileage vehicles
Box-Cox: Automated power transform to achieve normality

Why it works: Insurance data often has long-tailed distributions. Transformations compress the tail, making the data more suitable for linear models while preserving the relative ordering of observations.

3. Encoding Domain Knowledge as Constraints

Feature engineering isn't just about improving accuracy—it's about encoding business logic and actuarial principles that make models trustworthy and explainable. These constraints ensure that model predictions align with domain expertise and regulatory expectations.

Example: Collision Coverage Loss Cost

Actuarial principle: "The more expensive the car, the bigger the risk and the higher the loss cost for collision coverage."

Raw Implementation (Problematic)
• Use vehicle_value as a continuous predictor
• Let the model learn the relationship freely
• Risk: Model might learn non-monotonic patterns due to data noise
• Risk: Coefficient might be unstable across model refreshes
Constrained Implementation (Better)
Step 1: Create value bins: <$15k, $15k-$25k, $25k-$40k, $40k-$60k, $60k+
Step 2: Apply monotonic constraint: each higher bin must have ≥ loss cost
Step 3: Validate that predictions align with actuarial expectation
Benefits:
• Model predictions always respect actuarial logic
• Explainable to regulators: "higher value = higher cost"
• Robust across data changes and model refreshes
• Easier to diagnose when predictions seem wrong

Example: Driver Experience and Tenure

Actuarial principle: "Longer tenure with the company indicates lower risk (loyalty, responsible behavior)."

Implementation
Feature creation: tenure_years = current_date - policy_start_date
Binning: <1 year, 1-3 years, 3-5 years, 5-10 years, 10+ years
Constraint: Monotonically decreasing risk relativities
• New customers (<1 year): 1.15x base rate
• 1-3 years: 1.05x base rate
• 3-5 years: 1.00x base rate
• 5-10 years: 0.95x base rate
• 10+ years: 0.90x base rate

Example: Usage-Based Risk

Actuarial principle: "Higher mileage increases exposure and accident probability."

Implementation
Feature creation: annual_mileage (self-reported or telematics)
Capping: Cap at 95th percentile to handle extreme commuters
Binning: <5k, 5k-10k, 10k-15k, 15k-20k, 20k+
Constraint: Monotonically increasing loss cost
Interaction term: mileage × driver_age
Young drivers with high mileage = highest risk segment

4. Impact on Model Performance

Well-designed feature engineering delivers measurable improvements across multiple dimensions: predictive accuracy, model stability, regulatory acceptance, and operational maintainability.

Predictive Lift

Baseline model (raw features): Gini = 0.22
After binning + capping: Gini = 0.28 (+27% improvement)
After adding interaction terms: Gini = 0.34 (+55% total improvement)
Feature engineering captures non-linear patterns and feature interactions that raw data misses, leading to better risk segmentation and more accurate pricing.

Model Stability

Without capping: Coefficients vary ±15% across monthly refreshes
With capping + binning: Coefficients stable within ±3%
Transformations reduce sensitivity to outliers and data shifts, making models more reliable in production and easier to explain to stakeholders.

Regulatory Acceptance

Raw continuous features: Difficult to explain, regulators request detailed justification
Binned features with monotonic constraints: Clear actuarial logic, passes first review
Domain-constrained features align with actuarial principles, making rate filings easier to defend and faster to approve.

Operational Benefits

• Faster model refresh cycles (fewer validation failures)
• Easier to diagnose prediction errors (interpretable features)
• Reduced maintenance burden (stable coefficients)
• Better alignment with business stakeholders (explainable logic)

5. Practical Examples

Commercial Auto: Fleet Size and Loss Cost

Raw feature: number_of_vehicles (ranges from 1 to 500+)
Problem: Relationship is non-linear—small fleets have different risk profiles than large fleets
Solution:
1. Create bins: 1-5 vehicles, 6-10, 11-25, 26-50, 51-100, 100+
2. Add fleet_type: owner-operator, small business, mid-size, enterprise
3. Create interaction: fleet_size × industry_type
4. Apply constraint: larger fleets with professional management → lower per-vehicle risk
Result: Improved Gini by 0.06 points, better pricing for mid-market segment

Personal Auto: Credit Score and Territory

Raw features: credit_score (300-850), zip_code (10,000+ levels)
Problem: High dimensionality, interactions between credit and geography
Solution:
1. Bin credit_score: 300-579, 580-669, 670-739, 740-799, 800+
2. Group zip_codes into territories based on loss history
3. Create interaction: credit_tier × territory_risk_level
4. Apply constraints: monotonically decreasing risk with higher credit in all territories
Result: Better risk segmentation in urban markets, passed regulatory review without questions

Handling Rare Categories

Problem: Vehicle make/model has 1,500+ levels, many with <100 observations
Solution:
1. Identify top 50 makes/models by exposure
2. Group remaining into categories by vehicle characteristics:
• Luxury_Other
• Economy_Other
• Truck_Other
• Sports_Other
3. Add fallback category: Unknown (for new models not yet classified)
Result: Reduced model complexity, improved stability, no loss in predictive power

Key Takeaway:

Feature engineering is where data science meets domain expertise. The best transformations don't just improve model metrics—they encode actuarial principles, ensure regulatory compliance, and create models that stakeholders can trust and understand. In insurance pricing, this alignment between statistical performance and business logic is not optional; it's the foundation of sustainable, scalable pricing systems.