array_to_matrix {aifeducation}R Documentation

Array to matrix

Description

Function transforming an array to a matrix.

Usage

array_to_matrix(text_embedding)

Arguments

text_embedding

array containing the text embedding. The array should be created via an object of class TextEmbeddingModel.

Value

Returns a matrix which contains the cases in the rows and the columns represent the features of all sequences. The sequences are concatenated.

See Also

Other Auxiliary Functions: 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(), get_train_test_split(), is.null_or_na(), matrix_to_array_c(), split_labeled_unlabeled(), summarize_tracked_sustainability(), to_categorical_c()

Examples

#text embedding is an array of shape (batch,times,features)
example_embedding<-c(1:24)
example_embedding<-array(example_embedding,dim=c(4,3,2))
example_embedding

#Transform array to a matrix
#matrix has shape (batch,times*features)
array_to_matrix(example_embedding)

[Package aifeducation version 0.3.3 Index]