train_val_split_method2 {ADLP} | R Documentation |
Train-Validation Split by Accident Period Method 2
Description
Function for training/validation splitting.
Usage
train_val_split_method2(df, tri.size, val_ratio, test = FALSE)
Arguments
df |
Claims Triangle and other information. |
tri.size |
Triangle size. |
val_ratio |
Value between 0 and 1 as the approximate size of validaiton set. |
test |
Returns the test set if |
Details
Approximates the validation set by defining the training set as the cells
below the function ((b^{1/a} - x^{1/a})^a)
. Where b
is equal to
the triangle size and a
is optimised to best fit val_ratio
.
The training 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.
Value
List containing $train
, $valid
, $test
, which should partition
the input df
.
See Also
Examples
data("test_claims_dataset")
train_val <- train_val_split_method1(
df = test_claims_dataset,
tri.size = 40,
val_ratio = 0.3,
test = TRUE
)