
Prepare folds for multideconv cross-validation with processed training and test data
Source:R/cell_deconvolution.R
prepare_multideconv_folds.RdThis function processes a dataset for k-fold cross-validation using the multideconv framework. For each fold, it generates training and test datasets by computing deconvolution subgroups features from the deconvolution matrix. It also processes the entire dataset once to provide a final processed training set.
Value
A list of two elements:
processed_folds: A list of folds, where each fold contains:train_data: Processed training data with cell group features andtargetcolumn.test_data: Test data projected into the learned cell group feature space.obs_test: True class labels for the test set.rowIndex: Row indices corresponding to the test set.fold_name: Optional fold name if provided in thefoldslist.
train_cell_data_final: Final cell group feature matrix for the full dataset, including thetargetcolumn.
Details
The function runs the compute.deconvolution.analysis() function on each fold's training set and uses the trained projection
to compute the test set representation. It also runs multideconv on the full dataset to return the complete processed training set.