Skip to main content
Base class for all custom feature types in Fiddler models. CustomFeature provides the foundation for creating specialized feature types that enhance model monitoring and analysis. Custom features allow you to define derived metrics, embeddings, and enrichments that extend beyond basic model inputs and outputs for advanced drift detection and analysis. This is an abstract base class that should not be instantiated directly. Instead, use one of its concrete subclasses: Multivariate, VectorFeature, TextEmbedding, ImageEmbedding, or Enrichment.

Examples

Creating a multivariate feature from multiple columns:
feature = CustomFeature.from_columns(
    custom_name="user_behavior_cluster",
    cols=["clicks", "views", "time_spent"],
    n_clusters=5
)
Creating a custom feature from a dictionary:
feature_dict = {
    "name": "text_sentiment",
    "type": "FROM_TEXT_EMBEDDING",
    "column": "embedding_col",
    "source_column": "review_text"
}
feature = CustomFeature.from_dict(feature_dict)

name

type

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod from_columns()

Returns

Multivariate

classmethod from_dict()

Returns

Any

to_dict()

Returns

Dict[str, Any]