This function creates a train and validation sample based on stratified random sampling. The relative frequencies of each category in the train and validation sample equal the relative frequencies of the initial data (proportional stratified sampling).
get_train_test_split(embedding = NULL, target, val_size)
Returns a list
with the following components.
target_train:
Named factor
containing the labels of the training sample.
embeddings_train:
Object of class EmbeddedText containing the text embeddings for the training sample
target_test:
Named factor
containing the labels of the validation sample.
embeddings_test:
Object of class EmbeddedText containing the text embeddings for the validation sample
Object of class EmbeddedText.
Named factor
containing the labels of every case.
double
Ratio between 0 and 1 indicating the relative
frequency of cases which should be used as validation sample.
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_folds()
,
get_n_chunks()
,
get_stratified_train_test_split()
,
get_synthetic_cases()
,
is.null_or_na()
,
matrix_to_array_c()
,
split_labeled_unlabeled()
,
summarize_tracked_sustainability()
,
to_categorical_c()