Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-docs-2661.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.

Embedding examples
The following resources demonstrate the Embedding Projector in action before you try it yourself:Hello world
This minimal example shows the smallest amount of code needed to log embeddings and view them in the projector. W&B lets you log embeddings using thewandb.Table class. Consider the following example of three embeddings, each consisting of five dimensions:

Digits MNIST
The next example demonstrates a more realistic workflow with higher-dimensional data and richer overlays. While the preceding example shows the basic mechanics of logging embeddings, you typically work with many more dimensions and samples. Consider the MNIST Digits dataset (UCI ML hand-written digits dataset) made available through SciKit-Learn. This dataset has 1,797 records, each with 64 dimensions. The problem is a 10-class classification use case. You can also convert the input data to an image for visualization.
Logging options
The following sections describe the supported ways to structure embedding data when you log it to W&B. You can log embeddings in several formats:- Single embedding column: Often your data is already in a matrix-like format. In this case, you can create a single embedding column, where the data type of the cell values can be
list[int],list[float], ornp.ndarray. - Multiple numeric columns: The preceding two examples use this approach and create a column for each dimension. W&B accepts Python
intorfloatfor the cells.


- Directly from a dataframe using
wandb.Table(dataframe=df). - Directly from a list of data using
wandb.Table(data=[...], columns=[...]). - Build the table incrementally row by row (great if you have a loop in your code). Add rows to your table using
table.add_data(...). - Add an embedding column to your table (great if you have a list of predictions in the form of embeddings):
table.add_col("col_name", ...). - Add a computed column (great if you have a function or model you want to map over your table):
table.add_computed_columns(lambda row, ndx: {"embedding": model.predict(row)}).
Plotting options
After you log your embeddings, you can adjust how they are projected and rendered. After you select 2D Projection, click the gear icon to edit the rendering settings. Besides selecting the intended columns (see preceding sections), you can select an algorithm of interest along with the desired parameters. The following images show the parameters for UMAP and t-SNE.

W&B downsamples to a random subset of 1,000 rows and 50 dimensions for all three algorithms.