CreateGroupPartition: Create a group-based S3 object of class partition for the...

View source: R/Partitions.R

CreateGroupPartitionR Documentation

Create a group-based S3 object of class partition for the SetTarget function

Description

Group partitioning constructs data partitions such that all records with each level in the column specified by the parameter partitionKeyCols occur together in the same partition.

Usage

CreateGroupPartition(
  validationType,
  holdoutPct,
  partitionKeyCols,
  reps = NULL,
  validationPct = NULL
)

Arguments

validationType

character. String specifying the type of partition generated, either "TVH" or "CV".

holdoutPct

integer. The percentage of data to be used as the holdout subset.

partitionKeyCols

list. List containing a single string specifying the name of the variable used in defining the group partition.

reps

integer. The number of cross-validation folds to generate; only applicable when validationType = "CV".

validationPct

integer. The percentage of data to be used as the validation subset.

Details

This function is one of several convenience functions provided to simplify the task of starting modeling projects with custom partitioning options. The other functions are CreateRandomPartition, CreateStratifiedPartition, and CreateUserPartition.

Value

An S3 object of class 'partition' including the parameters required by the SetTarget function to generate a group-based partitioning of the modeling dataset.

See Also

CreateRandomPartition, CreateStratifiedPartition, CreateUserPartition.

Examples

CreateGroupPartition(validationType = "CV",
                     holdoutPct = 20,
                     partitionKeyCols = list("groupId"),
                     reps = 5)

datarobot documentation built on Nov. 3, 2023, 1:07 a.m.