Skip to content

Results are limited to Qoolqit v0.4.0

Product news
You are reading Qoolqit v0.4.0, an older version of this documentation. Go to the latest version (v1.5.0)

qoolqit.embedding.matrix_embedder

module
qoolqit.embedding.matrix_embedder

Classes

  • MatrixToGraphEmbedder — A family of embedders that map a matrix to a graph.

  • InteractionEmbedder — A matrix to graph embedder using the interaction embedding algorithm.

  • Blade — A matrix to graph embedder using the BLaDE algorithm.

class
MatrixToGraphEmbedder (algorithm: Callable, config: ConfigType)

Bases : BaseEmbedder[np.ndarray, DataGraph, ConfigType]

A family of embedders that map a matrix to a graph.

A custom algorithm and configuration can be set at initialization.

Default initializer for all embedders, taking an algorithm and a config.

An algorithm should be a standalone function that takes a piece of data of an InDataType and maps it to an OutDataType. Any extra configuration parameters taken as input by the algorithm function should be defined in the config dataclass, inheriting from EmbeddingConfig.

Parameters

  • algorithm : Callable — a callable to the algorithm function.

  • config : ConfigType — a config dataclass holding parameter values for the algorithm.

Attributes

  • config : ConfigType — Returns the config for the embedding algorithm.

  • algorithm : Callable — Returns the callable to the embedding algorithm.

  • info : str — Prints info about the embedding algorithm.

Methods

method
validate_input (data: np.ndarray) → None

Raises

  • TypeError

  • ValueError

method
validate_output (result: DataGraph) → None

Raises

  • TypeError

class
InteractionEmbedder ()

Bases : MatrixToGraphEmbedder[InteractionEmbeddingConfig]

A matrix to graph embedder using the interaction embedding algorithm.

Attributes

  • config : ConfigType — Returns the config for the embedding algorithm.

  • algorithm : Callable — Returns the callable to the embedding algorithm.

  • info : str — Prints info about the embedding algorithm.

class
Blade (config: BladeConfig = BladeConfig())

Bases : MatrixToGraphEmbedder[BladeConfig]

A matrix to graph embedder using the BLaDE algorithm.

Inits Blade.

Parameters

  • config : BladeConfig — configuration object for the BLaDE algorithm.

Attributes

  • config : ConfigType — Returns the config for the embedding algorithm.

  • algorithm : Callable — Returns the callable to the embedding algorithm.

  • info : str — Prints info about the embedding algorithm.

Methods

  • embed — Return a DataGraph with coordinates that embeds the input matrix.

method
embed (data: np.ndarray) → DataGraph

Return a DataGraph with coordinates that embeds the input matrix.

Validates the input, runs the embedding algorithm, and validates the output.

Parameters

  • data : np.ndarray — the matrix to embed into a DataGraph with coordinates.