Learn R Programming

aifeducation (version 0.3.3)

get_folds: Create cross-validation samples

Description

Function creates cross-validation samples and ensures that the relative frequency for every category/label within a fold equals the relative frequency of the category/label within the initial data.

Usage

get_folds(target, k_folds)

Value

Return a list with the following components:

  • val_sample: vector of strings containing the names of cases of the validation sample.

  • train_sample: vector of strings containing the names of cases of the train sample.

  • n_folds: int Number of realized folds.

  • unlabeled_cases: vector of strings containing the names of the unlabeled cases.

Arguments

target

Named factor containing the relevant labels/categories. Missing cases should be declared with NA.

k_folds

int number of folds.

See Also

Other Auxiliary Functions: array_to_matrix(), calc_standard_classification_measures(), check_embedding_models(), clean_pytorch_log_transformers(), create_iota2_mean_object(), create_synthetic_units(), generate_id(), get_coder_metrics(), get_n_chunks(), get_stratified_train_test_split(), get_synthetic_cases(), get_train_test_split(), is.null_or_na(), matrix_to_array_c(), split_labeled_unlabeled(), summarize_tracked_sustainability(), to_categorical_c()