Function for creating synthetic cases in order to balance the data for training with TEClassifierRegular or TEClassifierProtoNet]. This is an auxiliary function for use with get_synthetic_cases_from_matrix to allow parallel computations.
Arguments
- matrix_form
Named
matrixcontaining the text embeddings in matrix form. In most cases this object is taken from EmbeddedText$embeddings.- target
Named
factorcontaining the labels/categories of the corresponding cases.- required_cases
intNumber of cases necessary to fill the gab between the frequency of the class under investigation and the major class.- k
intThe number of nearest neighbors during sampling process.- method
vectorcontaining strings of the requested methods for generating new cases. Currently "knnor" from this package is available.- cat
stringThe category for which new cases should be created.
Value
Returns a list which contains the text embeddings of the new synthetic cases as a named data.frame and
their labels as a named factor.