Learn R Programming

ADLP (version 0.1.0)

train_val_split_method1: Train-Validation Split by Accident Period Method 1

Description

Function for training/validation splitting.

Usage

train_val_split_method1(df, tri.size, val_ratio, 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.

tri.size

Triangle size.

val_ratio

Value between 0 and 1 as the approximate size of validation set.

test

Returns the test set if TRUE .

Details

Approximates the validation set by taking the n most recent calendar years as validation to best fit val_ratio.

Validation set is therefore cells outside of this period but within the upper triangle. The test set is all observations in the lower triangle.

Note that accident period 1 and development period 1 will always be within the training set.

See Also

train_val_split

Examples

Run this code

data("test_claims_dataset")

train_val <- train_val_split_method1(
    df = test_claims_dataset,
    tri.size = 40,
    val_ratio = 0.3,
    test = TRUE
)

Run the code above in your browser using DataLab