whylogs.experimental.extras.embedding_metric#

Module Contents#

Classes#

DistanceFunction

Generic enumeration.

EmbeddingConfig

The rows of references are the reference vectors. A shape of (1, 1) indicates

EmbeddingMetric

Attributes#

whylogs.experimental.extras.embedding_metric.logger#
class whylogs.experimental.extras.embedding_metric.DistanceFunction#

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

euclidean#
cosine#
name()#

The name of the Enum member.

value()#

The value of the Enum member.

class whylogs.experimental.extras.embedding_metric.EmbeddingConfig#

Bases: whylogs.core.metrics.metrics.MetricConfig

The rows of references are the reference vectors. A shape of (1, 1) indicates there’s no reference matrix and the metric will not be updatable. It should still be mergeable with compatible metrics (details of compatability TBD). The rows must be in the same order as labels. If labels are not provided, “0” … “n” will be used, where n is the number of rows in the references matrix.

references: whylogs.core.stubs.np.ndarray#
labels: Optional[List[str]]#
distance_fn: DistanceFunction#
serialize_references: bool = True#
class whylogs.experimental.extras.embedding_metric.EmbeddingMetric#

Bases: whylogs.core.metrics.multimetric.MultiMetric

property namespace: str#
Return type

str

references: whylogs.experimental.extras.matrix_component.MatrixComponent#
labels: List[str]#
distance_fn: DistanceFunction#
serialize_references: bool#
merge(other: EmbeddingMetric) EmbeddingMetric#
Parameters

other (EmbeddingMetric) –

Return type

EmbeddingMetric

to_protobuf() whylogs.core.proto.MetricMessage#
Return type

whylogs.core.proto.MetricMessage

columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) whylogs.core.metrics.metrics.OperationResult#
Parameters

data (whylogs.core.preprocessing.PreprocessedColumn) –

Return type

whylogs.core.metrics.metrics.OperationResult

classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) EmbeddingMetric#
Parameters

msg (whylogs.core.proto.MetricMessage) –

Return type

EmbeddingMetric

classmethod zero(cfg: Optional[EmbeddingConfig] = None) EmbeddingMetric#
Parameters

cfg (Optional[EmbeddingConfig]) –

Return type

EmbeddingMetric