Skip to contents

This function fits a high-dimensional model using hexagonal bins and provides options to customize the modeling process, including the choice of bin centroids or bin means, removal of low-density hexagons, and averaging of high-dimensional data.

Usage

fit_highd_model(
  training_data,
  emb_df,
  bin1 = 4,
  r2,
  q = 0.1,
  is_bin_centroid = TRUE,
  is_rm_lwd_hex = FALSE,
  benchmark_to_rm_lwd_hex = NULL,
  col_start_highd = "x"
)

Arguments

training_data

A tibble that contains the training high-dimensional data.

emb_df

A tibble that contains embedding with a unique identifier.

bin1

Number of bins along the x axis.

r2

The ratio of the ranges of the original embedding components.

q

The buffer amount as proportion of data range.

is_bin_centroid

Logical, indicating whether to use bin centroids (default is TRUE).

is_rm_lwd_hex

Logical, indicating whether to remove low-density hexagons (default is FALSE).

benchmark_to_rm_lwd_hex

The benchmark value to remove low-density hexagons.

col_start_highd

The text prefix for columns in the high-dimensional data.

Value

A list containing the data frame with high-dimensional coordinates for 2D bin centroids (df_bin) and the data frame containing information about hexagonal bin centroids (df_bin_centroids) in 2D.

Examples

scurve_umap_scaled_obj <- s_curve_obj$nldr_scaled_obj
lim1 <- scurve_umap_scaled_obj$lim1
lim2 <- scurve_umap_scaled_obj$lim2
r2 <- diff(lim2)/diff(lim1)
fit_highd_model(training_data = s_curve_noise_training,
emb_df = s_curve_noise_umap_scaled, bin1 = 4, r2 = r2,
col_start_highd = "x")
#> Error in if (r2 > check_factor) {    a1 <- (1 + 2 * q)/(bin1 - 1)} else {    a1 <- (2 * (r2 + q * (1 + r2)))/(sqrt(3) * (bin2 - 1))}: argument is of length zero