Learn R Programming

ADLP (version 0.1.0)

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.

See Also

train_val_split

Examples

Run this code
data("test_claims_dataset")

train_val <- train_val_split_by_AP(
    df = test_claims_dataset,
    accident_periods = 1:40,
    max_dev_periods = 40:1,
    test = TRUE
)

Run the code above in your browser using DataLab