R Under development (unstable) (2024-12-20 r87452 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # to obtain an example madelon dataset > library(MDFS) > mdfs_omp_set_num_threads(1) # only to pass CRAN checks NULL > data(madelon) > data <- madelon$data > decision <- madelon$decision > > # to get repeatable results > set.seed(12345) > > > # > # Main flow starts below this comment. > # > > library(RAFS) > > # using 2 CV loops (seeds) only to speed things up > rafs_results <- run_rafs(data, decision, seeds = sample.int(32767, 2)) > > # finding representatives > rafs_reps_popcnts <- get_rafs_reps_popcnts(rafs_results, n_clusters_range = 2:5) > > rafs_top_reps_5 <- get_rafs_top_reps_from_popcnts(rafs_reps_popcnts$stig_single, 5) > > rafs_all_reps_5 <- get_rafs_all_reps_from_popcnts(rafs_reps_popcnts$stig_single, 5) > > # findings representative tuples > rafs_rep_tuples_popcnts <- get_rafs_rep_tuples_popcnts(rafs_results, n_clusters_range = 2:5) > > rafs_top_tuple_5 <- get_rafs_top_rep_tuples_from_popcnts(rafs_rep_tuples_popcnts$stig_single, 5) > > # learning more about the dataset structure > > # how many times did the representatives build together the tuple? (i.e., be in different clusters AND be representatives at the same time) > rafs_rep_tuples_matrix <- get_rafs_rep_tuples_matrix(rafs_results, rafs_all_reps_5, n_clusters_range = 2:5) > > # how many times did the representatives share the same cluster? > rafs_occurrence_matrix <- get_rafs_occurrence_matrix(rafs_results, rafs_all_reps_5, n_clusters_range = 2:5) > > proc.time() user system elapsed 26.09 0.15 26.23