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.
Usage
create_synthetic_units_from_matrix(
matrix_form,
target,
required_cases,
k,
method,
cat,
k_s,
max_k
)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.- k_s
intNumber of ks in the complete generation process.- max_k
intThe maximum number of nearest neighbors during sampling process.
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.
See also
Other Utils Developers:
auto_n_cores(),
create_object(),
generate_id(),
get_n_chunks(),
get_synthetic_cases_from_matrix(),
get_time_stamp(),
matrix_to_array_c(),
tensor_to_matrix_c(),
to_categorical_c()