Skip to contents

This function computes the weighted mean of the specified columns in the training data based on the distances from the average points in the non-linear dimensionality reduction (NLDR) space.

Usage

weighted_highD_data(
  training_data,
  nldr_df_with_id,
  hb_object,
  column_start_text = "x"
)

Arguments

training_data

A data frame containing the training data with an ID column.

nldr_df_with_id

A data frame containing 2D embeddings with an unique identifier.

hb_object

An object containing information about hexbin IDs.

column_start_text

The starting text of the column names in the training_data that should be considered for the weighted mean. Default is "x".

Value

A data frame with the computed weighted mean for each specified column.

See also

Examples

num_bins_x <- 4
shape_value <- 1.833091
hexbin_data_object <- extract_hexbin_centroids(nldr_df = s_curve_noise_umap,
num_bins = num_bins_x, shape_val = shape_value)
hexdf_data <- hexbin_data_object$hexdf_data
hb_object <- hexbin_data_object$hb_data
weighted_highD_data(training_data = s_curve_noise_training,
nldr_df_with_id = s_curve_noise_umap, hb_object = hb_object, column_start_text = "x")
#> # A tibble: 16 × 8
#>    hb_id      x1     x2       x3        x4        x5        x6        x7
#>    <int>   <dbl>  <dbl>    <dbl>     <dbl>     <dbl>     <dbl>     <dbl>
#>  1     1 -0.987  1.38   -1.16     0.00156   0.0112   -0.0293    0.00135 
#>  2     2 -0.518  1.74   -1.82     0.00856  -0.00304  -0.00211  -0.00253 
#>  3     6 -0.412  0.389  -1.86    -0.000733 -0.000295 -0.0369    0.000191
#>  4     7  0.584  1.26   -1.77     0.0123   -0.00998  -0.00123  -0.000406
#>  5    11 -0.175  0.0562 -1.98     0.00204  -0.00179   0.0112   -0.00111 
#>  6    12  0.572  0.0605 -1.76     0.00273   0.0107    0.0308   -0.00430 
#>  7    13  0.980  0.552  -1.04     0.00143  -0.00296   0.0207    0.00641 
#>  8    17  0.713  0.406  -0.298   -0.0133    0.0127   -0.0697   -0.00924 
#>  9    18  0.763  1.47   -0.394   -0.00223   0.000814  0.0307   -0.000439
#> 10    24 -0.0511 0.999   0.00835  0.0118    0.00227   0.00598   0.00329 
#> 11    28 -0.506  1.92    0.138    0.0159   -0.0149   -0.0841    0.00453 
#> 12    29 -0.900  1.13    0.620   -0.00675  -0.00196   0.0394    0.000203
#> 13    38 -0.613  1.69    1.79     0.0119   -0.00418  -0.000519 -0.00251 
#> 14    39 -0.223  0.498   1.89    -0.00291   0.00145  -0.00323  -0.000516
#> 15    44  0.590  1.70    1.73     0.00468  -0.00115  -0.0293    0.00182 
#> 16    45  0.806  0.604   1.50    -0.00503   0.00522  -0.00644  -0.00350