Learn R Programming

SaturnCoefficient (version 1.3)

calculatesSaturnContinuityTrustworthiness: Function that calculates the Saturn coefficient, trustworthiness score, and the continuity score of a UMAP dimensionality reduction

Description

Function that calculates the Saturn coefficient, trustworthiness score, and the continuity score of a UMAP dimensionality reduction

Usage

calculatesSaturnContinuityTrustworthiness(
  original_matrix,
  umap_output_layout,
  VERBOSE
)

Value

a dataframe containing the Saturn coefficient, the trustworthiness score, and the continuity score

Arguments

original_matrix

input matrix

umap_output_layout

output matrix of UMAP applied to original_matrix

VERBOSE

prints some intermediate message to standard output or not

Examples

Run this code

this_nrows <- 200
this_ncols <- 100
this_min <- 0
this_max <- 10000
noise_random_matrix <- matrix(runif(n = this_nrows * this_ncols,
     min = this_min, max = this_max), nrow = this_nrows)
input_matrix <- as.matrix(noise_random_matrix)
these_nearest_neighbors <- 15
this_min_dist <- 0.05

library("umap")
custom.settings <- umap::umap.defaults
custom.settings$"n_neighbors" <- these_nearest_neighbors
custom.settings$"min_dist" <- this_min_dist

x_umap <- umap::umap(input_matrix, config=custom.settings)

this_verbose <- FALSE
theseThreeMetrics <- calculatesSaturnContinuityTrustworthiness(input_matrix,
     x_umap$"layout",  this_verbose)
print(theseThreeMetrics)

Run the code above in your browser using DataLab