train_val_split_by_AP {ADLP}R Documentation

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)

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.

Value

List containing ⁠$train⁠, ⁠$valid⁠, ⁠$test⁠, which should partition the input df.

See Also

train_val_split

Examples

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
)


[Package ADLP version 0.1.0 Index]