Skip to contents

Given a test dataset, the centroid coordinates of hexagonal bins in 2D and high-dimensional space, predict the 2D embeddings for each data point in the test dataset.

Usage

predict_2d_embeddings(test_data, df_bin_centroids, df_bin, type_NLDR = "UMAP")

Arguments

test_data

The test dataset containing high-dimensional coordinates and an unique identifier.

df_bin_centroids

Centroid coordinates of hexagonal bins in 2D space.

df_bin

Centroid coordinates of hexagonal bins in high dimensions.

type_NLDR

The type of non-linear dimensionality reduction (NLDR) used. Default is "UMAP".

Value

A data frame with predicted 2D embedding for each data point in the test dataset.

Examples

model <- fit_high_d_model(training_data = s_curve_noise_training,
nldr_df_with_id = s_curve_noise_umap)
df_bin_centroids <- model$df_bin_centroids
df_bin <- model$df_bin
predict_2d_embeddings(test_data = s_curve_noise_test, df_bin_centroids = df_bin_centroids,
df_bin = df_bin, type_NLDR = "UMAP")
#> # A tibble: 25 × 4
#>    pred_UMAP_1 pred_UMAP_2    ID pred_hb_id
#>          <dbl>       <dbl> <dbl>      <dbl>
#>  1      -1.84      -2.44       5          9
#>  2       1.02       0.862     10         40
#>  3       1.02       0.862     13         40
#>  4      -2.32      -1.62      18         16
#>  5      -1.36      -1.62      27         17
#>  6      -1.36      -1.62      28         17
#>  7       1.02       0.862     29         40
#>  8       1.50       1.69      30         48
#>  9      -1.84      -2.44      32          9
#> 10       0.547      0.0355    36         33
#> # ℹ 15 more rows