Aporia Documentation
Get StartedBook a Demo🚀 Cool StuffBlog
V1
V1
  • Welcome to Aporia!
  • 🤗Introduction
    • Quickstart
    • Support
  • 💡Core Concepts
    • Why Monitor ML Models?
    • Understanding Data Drift
    • Analyzing Performance
    • Tracking Data Segments
    • Models & Versions
    • Explainability
  • 🏠Storing your Predictions
    • Overview
    • Real-time Models (Postgres)
    • Real-time Models (Kafka)
    • Batch Models
    • Kubeflow / KServe
    • Logging to Aporia directly
  • 🚀Model Types
    • Regression
    • Binary Classification
    • Multiclass Classification
    • Multi-Label Classification
    • Ranking
  • 📜NLP
    • Intro to NLP Monitoring
    • Example: Text Classification
    • Example: Token Classification
    • Example: Question Answering
  • 🍪Data Sources
    • Overview
    • Amazon S3
    • Athena
    • BigQuery
    • Delta Lake
    • Glue Data Catalog
    • PostgreSQL
    • Redshift
    • Snowflake
  • ⚡Monitors
    • Overview
    • Data Drift
    • Metric Change
    • Missing Values
    • Model Activity
    • Model Staleness
    • New Values
    • Performance Degradation
    • Prediction Drift
    • Value Range
    • Custom Metric
  • 📡Integrations
    • Slack
    • JIRA
    • New Relic
    • Single Sign On (SAML)
    • Webhook
    • Bodywork
  • 🔑API Reference
    • Custom Metric Definition Language
    • REST API
    • SDK Reference
    • Metrics Glossary
Powered by GitBook
On this page
  1. Model Types

Regression

Regression models predict a numeric value. In Aporia, these models are represented with the regression model type.

Examples of regression problems:

  • What will the temperature be in Seattle tomorrow?

  • For product X, how many units will sell?

  • How many days until this customer stops using the application?

  • What price will this house sell for?

Integration

Regression predictions are usually represented in a database with a numeric column. For example:

id
feature1 (numeric)
feature2 (boolean)
predicted_temperature (numeric)
actual_temperature (numeric)
timestamp (datetime)

1

13.5

True

22.83

24.12

2017-01-01 12:00:00

2

123

False

26.04

25.99

2017-01-01 12:01:00

3

42

True

29.01

11.12

2017-01-01 12:02:00

To monitor this model, we will create a new model version with a schema that includes a numeric prediction:

apr_model = aporia.create_model_version(
  model_id="<MODEL_ID>", # You will need to create a model with this MODEL_ID in advance
  model_version="v1",
  model_type="regression"
  features={
     ...
  },
  predictions={
    "predicted_temperature": "numeric",
  },
)

To connect this model to Aporia from your data source, call the connect_serving(...) API:

apr_model.connect_serving(
  data_source=my_data_source,

  id_column="id",
  timestamp_column="timestamp",

  # Map the actual_temperature column as the label for the 
  # predicted_temperature. 
  labels={
    # Prediction name -> Column name
    "predicted_temperature": "actual_prediction"
  }
)

Don't want to connect to a database?

PreviousLogging to Aporia directlyNextBinary Classification

Last updated 2 years ago

Check out the for more information about how to connect all other available data sources.

Don't worry - you can

🚀
data sources section
log your predictions directly to Aporia.