Centroid Distance (beta)

  • Fiddler uses KMeans based system to determine which cluster a particular CustomFeature belongs to.
  • This Centroid Distance enrichment calculates the distance from the closest centroid calculated by model monitoring.
  • A new numeric column with distances to the closest centroid is added to the events table.
  • To enable set enrichment parameter tocentroid_distance.
fdl.ModelInfo.from_dataset_info(
    dataset_info=dataset_info,
    display_name='llm_model',
    model_task=fdl.core_objects.ModelTask.LLM,
    custom_features = [
      fdl.Enrichment(
        name='question_embedding',
        enrichment='embedding',
        columns=['question'],
      ),
      fdl.TextEmbedding(
          name='question_cf',
          source_column='question',
          column='question_embedding',
      ),
      fdl.Enrichment(
        name='Centroid Distance',
        enrichment='centroid_distance',
        columns=['question_cf'],
      ),
    ]
)

The above example will lead to generation of new column

  • FDL Centroid Distance (question_embedding)(float) : distance from the nearest K-Means centroid present in
    question_embedding

Note

Does not calculate membership for preproduction data, so you cannot calculate drift.