train_val_split_by_AP: Train-Validation Split by Accident Period
Description
Function for training/validation splitting.
Usage
train_val_split_by_AP(df, accident_periods, max_dev_periods, test = FALSE)
Value
List containing $train, $valid, $test, which should partition
the input df.
Arguments
df
Claims Triangle and other information. data.frame format of
claims and related information for each cell. Dataframe will have columns
origin and dev as columns 1 and 2 respectively.
accident_periods
Vector of accident periods. Will be equivalent to
1:Triangle_Size
max_dev_periods
Vector of development periods
test
Returns the test set if TRUE
Details
Assigns training set defined by a maximum development period for each
accident period: \((x_{ij} <= MaxDP(i))\).
Validation set is therefore cells outside of this period but within the
upper triangle. The test set is all observations in the lower triangle.