batch_snf | R Documentation |
This is the core function of the metasnf
package. Using the information
stored in a settings_df (see ?settings_df) and a data list
(see ?data_list), run repeated complete SNF pipelines to generate
a broad space of post-SNF cluster solutions.
batch_snf(dl, sc, processes = 1, return_sim_mats = FALSE, sim_mats_dir = NULL)
dl |
A nested list of input data from |
sc |
An |
processes |
Specify number of processes used to complete SNF iterations
|
return_sim_mats |
If TRUE, function will return a list where the first element is the solutions data frame and the second element is a list of similarity matrices for each row in the sol_df. Default FALSE. |
sim_mats_dir |
If specified, this directory will be used to save all generated similarity matrices. |
By default, returns a solutions data frame (class "data.frame"), a
a data frame containing one row for every row of the provided settings
matrix, all the original columns of that settings data frame, and new columns
containing the assigned cluster of each observation from the cluster
solution derived by that row's settings. If return_sim_mats
is
TRUE, the function will instead return a list containing the
solutions data frame as well as a list of the final similarity matrices (class
"matrix") generated by SNF for each row of the settings data frame. If
suppress_clustering
is TRUE, the solutions data frame will not be returned
in the output.
input_dl <- data_list(
list(gender_df, "gender", "demographics", "categorical"),
list(diagnosis_df, "diagnosis", "clinical", "categorical"),
uid = "patient_id"
)
sc <- snf_config(input_dl, n_solutions = 3)
# A solutions data frame without similarity matrices:
sol_df <- batch_snf(input_dl, sc)
# A solutions data frame with similarity matrices:
# sol_df <- batch_snf(input_dl, sc, return_sim_mats = TRUE)
# sim_mats_list(sol_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.