Aporia Documentation
Get StartedBook a Demo🚀 Cool StuffBlog
V2
V2
  • 📖Aporia Docs
  • 🤗Introduction
    • Quickstart
    • Support
  • 💡Core Concepts
    • Why Monitor ML Models?
    • Understanding Data Drift
    • Analyzing Performance
    • Tracking Data Segments
    • Models & Versions
  • 🚀Deployment
    • AWS
    • Google Cloud
    • Azure
    • Databricks
    • Offline / On-Prem
    • Platform Architecture
  • 🏠Storing your Predictions
    • Overview
    • Real-time Models (Postgres)
    • Real-time Models (Kafka)
    • Batch Models
    • Kubeflow / KServe
  • 🧠Model Types
    • Regression
    • Binary Classification
    • Multiclass Classification
    • Multi-Label Classification
    • Ranking
  • 🌈Explainability
    • SHAP values
  • 📜NLP
    • Intro to NLP Monitoring
    • Example: Text Classification
    • Example: Token Classification
    • Example: Question Answering
  • 🍪Data Sources
    • Overview
    • Amazon S3
    • Athena
    • BigQuery
    • Databricks
    • Glue Data Catalog
    • Google Cloud Storage
    • PostgreSQL
    • Redshift
    • Snowflake
    • Microsoft SQL Server
    • Oracle
  • ⚡Monitors & Alerts
    • Overview
    • Data Drift
    • Metric Change
    • Missing Values
    • Model Activity
    • Model Staleness
    • Performance Degradation
    • Prediction Drift
    • Value Range
    • Custom Metric
    • New Values
    • Alerts Consolidation
  • 🎨Dashboards
    • Overview
  • 🤖ML Monitoring as Code
    • Getting started
    • Adding new models
    • Data Segments
    • Custom metrics
    • Querying metrics
    • Monitors
    • Dashboards
  • 📡Integrations
    • Slack
    • Webhook
    • Teams
    • Single Sign On (SAML)
    • Cisco
  • 🔐Administration
    • Role Based Access Control (RBAC)
  • 🔑API Reference
    • REST API
    • API Extended Reference
    • Custom Segment Syntax
    • Custom Metric Syntax
    • Code-Based Metrics
    • Metrics Glossary
  • ⏩Release Notes
    • Release Notes 2024
    • Release Notes 2023
Powered by GitBook
On this page
  1. API Reference

Custom Segment Syntax

PreviousAPI Extended ReferenceNextCustom Metric Syntax

Last updated 8 months ago

In Aporia, are defined using SQL-based syntax.

The definition is written as a condition that will be passed to a WHERE clause. The condition should be based only on fields within your model version schema.

The following SQL operators are supported:

>, <, <=, >=, !=, &, |, =, is, not, or, and

Categorical fields are ingested as strings. If your segment includes a comparison of a categorical field and a constant value, remember to quote the constant value.

Examples

  1. Assume we have a numeric field "age" and a boolean field "is_customer" in our schema, we can create a segment based on these fields as follows:

--Segment of customers above age 23
age > 23 and is_customer = True
  1. Assume we have a categorical field "partner_type" and categorical field "deal_step" in our schema, we can create a segment based on these fields as follows:

--Segment of all 'Gold' partners with missing deal stage
partner_type = 'Gold' and deal_stage is null
  1. Assume we have a categorical field "region_code" in our schema, we can create a segment based on this field as follows:

--Segment of all data with region_code different than '123'
region_code != '123'
🔑
custom segments
Custom Segments Creation