# Insurance settings
URL: https://docs.datarobot.com/en/docs/reference/pred-ai-ref/insurance-settings.html

> Provides reference content for features that address frequent weighting needs of the insurance industry.

# Insurance settings

The following sections describe the weighting features available in advanced experiment setup. These settings are typically used by the insurance industry.

Experiments built using the offset, exposure, and/or count of events parameters produce the same DataRobot insights as projects that do not. However, DataRobot excludes offset, exposure, and count of events columns from the predictive set. That is, the selected columns are not part of the [Coefficients](https://docs.datarobot.com/en/docs/workbench/nxt-workbench/experiments/experiment-insights/coefficients.html), [Individual Prediction Explanations](https://docs.datarobot.com/en/docs/workbench/nxt-workbench/experiments/experiment-insights/shap-predex.html), or [Feature Impact](https://docs.datarobot.com/en/docs/workbench/nxt-workbench/experiments/experiment-insights/feature-impact.html) visualizations; they are treated as special columns throughout the experiment. While the exposure, offset, and count of events columns do not appear in these displays as features, their values have been used in training.

## Exposure

In regression problems, Exposure can be used to weight features in order to handle observations that are not of equal duration. It's commonly used in insurance use cases to introduce a measure of period duration. For example, in a use case where each row represents a policy-year, a policy that was applicable for half of the year will have an Exposure parameter of 0.5. DataRobot handles a feature selected for exposure as a special column, adding it to raw predictions when building or scoring a model. The selected column(s) must be present in any dataset later uploaded for predictions.

Only [optimization metrics](https://docs.datarobot.com/en/docs/classic-ui/modeling/build-models/build-basic/model-data.html#optimization-metric) with the log link function (Poisson, Gamma, or Tweedie deviance) can make use of exposure values in modeling. For these optimization metrics, DataRobot log transforms the value of the field you specify as an exposure (you do not need to do it). If you select otherwise, DataRobot returns an informative message. See [below](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/insurance-settings.html#offset-and-exposure-in-modeling) for more training and prediction application details.

## Count of events

The Count of events parameter improves modeling of a zero-inflated target by adding information on the frequency of non-zero events. Frequency x Severity (two-stage) models handle it as a special column. The frequency stage uses the column to model the frequency of non-zero events. The severity stage normalizes the severity of non-zero events in the column and uses that value as the target. This improves interpretability of frequency and severity coefficients. The column is not used for making predictions on new data.

The Count of events parameter is used in two-stage models—that is, Frequency-Severity and Frequency-Cost blueprints. Stages for each are described below.

Frequency-Severity models

1. Model the frequency of events usingCount of eventsas the target.
2. Model the severity of non-zero events, where the target is the normalized target column (target divided byCount of events), and theCount of eventscolumn is used as the weight.

Frequency-Cost

1. Model the frequency of events usingCount of eventsas the target.
2. Model the severity of events using the original target and predictions from stage 1 as an offset.

The first stage of both these two stage models, Frequency, is always a poisson regression model. If you supply a count feature, that value is the stage one target. Otherwise, DataRobot creates a 0/1 target.

## Offset

In regression and binary classification problems, the Offset parameter sets feature(s) that should be treated as a fixed component for modeling (coefficient of 1 in generalized linear models or gradient boosting machine models). Offsets are often used to incorporate pricing constraints or to boost existing models. DataRobot handles a feature selected for offset as a special column, adding it to raw predictions when building or scoring a model; the selected column(s) must be present in any dataset later uploaded for predictions.

- Forregressionproblems, if theoptimization metricis Poisson, Gamma, or Tweedie deviance, DataRobot uses the log link function, in which case offsets should be log transformed in advance. Otherwise, DataRobot uses the identity link function and no transformation is needed for offsets.
- Forbinary classificationproblems, DataRobot uses the logit link function, in which case offsets should be logit transformed in advance.

See [below](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/insurance-settings.html#offset-and-exposure-in-modeling) for more training and prediction application details.

## Offset and exposure in modeling

During training, offset and exposure are incorporated into modeling using the following logic:

| Project metric | Modeling logic |
| --- | --- |
| RMSE | Y-offset ~ X |
| Poisson/Tweedie/Gamma/RMSLE | ln(Y/Exposure) - offset ~ X |

When making predictions, the following logic is applied:

| Project metric | Prediction calculation logic |
| --- | --- |
| RMSE | model(X) + offset |
| Poisson/Tweedie/Gamma/RMSLE | exp(model(X) + offset) * exposure |

---
