View source: R/clustering_pipeline.R
clusteval_scoring | R Documentation |
Computes averages of metrics from pipeline output and also returns the best combination based on a weighted sum of metrics.
clusteval_scoring(...)
scoring(
res,
by = c("datname", "drname", "k", "m", "mkkm_mr_lambda"),
wsum = TrainStabilityJaccard + Silhouette,
significance_level = 0.05,
summarise = TRUE,
format_names = TRUE
)
get_best_result(res, scores)
... |
passed to |
res |
result from |
by |
character vector containing column names to group analysis by |
wsum |
an expression that indicates how a combined score is computed |
significance_level |
p-value cutoff for computing rejection rates |
summarise |
If FALSE, adds |
format_names |
If TRUE, formats internally used method names etc. to more user friendly names. |
scores |
scores from |
Metrics are renamed for convenience:
[Train/Test]Stability[Jaccard/ARI/NMI]
[NMI/ARI/ChisqRR].<batch>
[NMI/ARI].<subtype>
...
list
of all and best scores
Returns a list
containing a data.frame
$all
of all scores and
a single row $best
with the best score according to wsum
.
clusteval_scoring()
: Alias for scoring
get_best_result()
: Retrieves best clustering from CV results based on scores.
In practice retrieves reference fold result from first run matching the best results.
library(COPS)
res <- COPS(ad_ge_micro_zscore,
association_data = ad_studies,
parallel = 1, nruns = 2, nfolds = 5,
dimred_methods = c("pca", "umap", "tsne"),
cluster_methods = c("hierarchical", "kmeans"),
distance_metric = "euclidean",
n_clusters = 2:4)
scores <- scoring(res, wsum = Silhouette - GSE.nmi, summarise = TRUE)
best <- get_best_result(res, scores)
head(best$embedding)
head(best$clusters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.