View source: R/gam_construct_tariff_classes.R
| add_tariff_segments | R Documentation |
Adds the tariff segments derived by derive_tariff_segments() as a new factor
column to a portfolio data set. This is the recommended way to attach derived
tariff segments to the same portfolio rows that were used to fit the risk
factor GAM.
add_tariff_segments(data, segments, name = NULL, overwrite = FALSE)
data |
A data frame to which the tariff segments should be added. |
segments |
Object of class |
name |
Character string. Name of the new output column. If |
overwrite |
Logical. If |
A data frame with the derived tariff segment column added.
Martin Haringa
## Not run:
age_segments <- risk_factor_gam(
MTPL,
risk_factor = "age_policyholder",
claim_count = "nclaims",
exposure = "exposure"
) |>
derive_tariff_segments()
MTPL |>
add_tariff_segments(age_segments, name = "age_policyholder_segment")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.