-
Notifications
You must be signed in to change notification settings - Fork 50
Embedding
class Embedding(Asset)An Embedding asset.
def __init__(embedding=None,
name=None,
text=None,
color=None,
projection="pca",
include=True,
file_name=None,
metadata=None,
source=None,
unserialize=False,
dimensions=PROJECTION_DIMENSIONS,
scale=False,
**kwargs)Create an embedding vector.
Arguments:
-
embedding- a vector (list of numbers) -
name- (str) a name that provides the color (if not given below) and set name to which this embedding point belongs -
text- (str) text that will show when you hover over point in expanded view -
color- (str) a string that represents a color for the chart, typically given as a "rrggbb" hex string where "rr" is between "00" and "ff". -
projection- (str) the type of projection either 'pca', 'umap', or 't-sne' -
include- (bool) whether to include this vector when determining the projection. Useful if you want to see one part of the datagrid in the project of another. -
dimensions- (int) maximum number of dimensions -
kwargs- (dict) optional keyword arguments for projection algorithm -
scale- (bool) boolean indicating whether each column should be normalized -
kwargs- (keys, values) passed to the projection constructor -
NOTE- when using 't-sne', you cannot have any row that is excluded from the projection. That is because t-SNE does not allow arbitrary mappings.
Example:
>>> import kangas as kg
>>> dg = kg.DataGrid()
>>> for row in rows:
>>> target = row[0]
>>> kg.append([kg.Embedding(row[1:], name=target)])
>>> dg.save("embeddings.datagrid")def log_and_serialize(datagrid, row_id)Override to save row_id.
Kangas DataGrid is completely open source; sponsored by Comet ML
-
Home
- User Guides
- Installation - installing kangas
- Reading data - importing data
- Constructing DataGrids - building from scratch
- Exploring data - exploration and analysis
- Examples - scripts and notebooks
- Kangas Command-Line Interface
- Kangas Python API
- Integrations - with Hugging Face and Comet
- User Interface
- FAQ - Frequently Asked Questions
- Under the Hood
- Security - issues related to security
- Development - setting up a development environment
- Roadmap - plans and known issues
- User Guides