get_synthetic_cases_from_matrix: Create synthetic cases for balancing training data

View source: R/utils_DataManager.R

get_synthetic_cases_from_matrixR Documentation

Create synthetic cases for balancing training data

Description

This function creates synthetic cases for balancing the training with classifier models.

Usage

get_synthetic_cases_from_matrix(
  matrix_form,
  times,
  features,
  target,
  sequence_length,
  method = "knnor",
  min_k = 1L,
  max_k = 6L
)

Arguments

matrix_form

Named matrix containing the text embeddings in a matrix form.

times

int for the number of sequences/times.

features

int for the number of features within each sequence.

target

Named factor containing the labels of the corresponding embeddings.

sequence_length

int Length of the text embedding sequences.

method

vector containing strings of the requested methods for generating new cases. Currently "knnor" from this package is available.

min_k

int The minimal number of nearest neighbors during sampling process.

max_k

int The maximum number of nearest neighbors during sampling process.

Value

list with the following components:

  • syntetic_embeddings: Named data.frame containing the text embeddings of the synthetic cases.

  • syntetic_targets: Named factor containing the labels of the corresponding synthetic cases.

  • n_syntetic_units: table showing the number of synthetic cases for every label/category.

See Also

Other Utils Developers: auto_n_cores(), create_object(), create_synthetic_units_from_matrix(), generate_id(), get_n_chunks(), get_time_stamp(), matrix_to_array_c(), tensor_to_matrix_c(), to_categorical_c()


aifeducation documentation built on Nov. 19, 2025, 5:08 p.m.