get_embed_usage"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Introduction

The get_embed function retrieves embeddings based on provided input data. This vignette demonstrates the usage of the get_embed function with example datasets included in the MUGS package.


Load the Required Library

Ensure the MUGS package is loaded before running the example:

library(MUGS)

Load Example Data

Load the example datasets for the get_embed function:

set.seed(1)
S <- matrix(rnorm(100^2), 100, 100)
library(rsvd)
svd <- rsvd(S, 20)

Run the get_embed Function

Run the get_embed function to extract embeddings from the data:

# Example usage of get_embed
U <- get_embed(svd, d=10, normalize=TRUE)

Examine the Output

Explore the structure and key components of the output:

# View the structure of the output
str(U)

# Display the first few rows of the results
cat("\nEmbedding Results (first 5 rows):\n")
print(head(U, 5))

Notes

  1. Input Data: Ensure that U.1 and S.1 are properly formatted matrices or data frames.
  2. Output Structure: The output contains embeddings derived from the input data, which can be used in downstream analysis.

Summary

This vignette demonstrated the use of the get_embed function to retrieve embeddings from input data. Use this function to process your data and extract meaningful embeddings for further applications.



Try the MUGS package in your browser

Any scripts or data that you put into this service are public.

MUGS documentation built on June 8, 2025, 12:35 p.m.