LogoLogo
👨‍💻 API Reference📣 Release Notes📺 Request a Demo
  • Introduction to Fiddler
    • Monitor, Analyze, and Protect your ML Models and Gen AI Applications
  • Fiddler Doc Chatbot
  • First Steps
    • Getting Started With Fiddler Guardrails
    • Getting Started with LLM Monitoring
    • Getting Started with ML Model Observability
  • Tutorials & Quick Starts
    • LLM and GenAI
      • LLM Evaluation - Compare Outputs
      • LLM Monitoring - Simple
    • Fiddler Free Guardrails
      • Guardrails - Quick Start Guide
      • Guardrails - Faithfulness
      • Guardrails - Safety
      • Guardrails FAQ
    • ML Observability
      • ML Monitoring - Simple
      • ML Monitoring - NLP Inputs
      • ML Monitoring - Class Imbalance
      • ML Monitoring - Model Versions
      • ML Monitoring - Ranking
      • ML Monitoring - Regression
      • ML Monitoring - Feature Impact
      • ML Monitoring - CV Inputs
  • Glossary
    • Product Concepts
      • Baseline
      • Custom Metric
      • Data Drift
      • Embedding Visualization
      • Fiddler Guardrails
      • Fiddler Trust Service
      • LLM and GenAI Observability
      • Metric
      • Model Drift
      • Model Performance
      • ML Observability
      • Trust Score
  • Product Guide
    • LLM Application Monitoring & Protection
      • LLM-Based Metrics
      • Embedding Visualizations for LLM Monitoring and Analysis
      • Selecting Enrichments
      • Enrichments (Private Preview)
      • Guardrails for Proactive Application Protection
    • Optimize Your ML Models and LLMs with Fiddler's Comprehensive Monitoring
      • Alerts
      • Package-Based Alerts (Private Preview)
      • Class Imbalanced Data
      • Enhance ML and LLM Insights with Custom Metrics
      • Data Drift: Monitor Model Performance Changes with Fiddler's Insights
      • Ensuring Data Integrity in ML Models And LLMs
      • Embedding Visualization With UMAP
      • Fiddler Query Language
      • Model Versions
      • How to Effectively Use the Monitoring Chart UI
      • Performance Tracking
      • Model Segments: Analyze Cohorts for Performance Insights and Bias Detection
      • Statistics
      • Monitoring ML Model and LLM Traffic
      • Vector Monitoring
    • Enhance Model Insights with Fiddler's Slice and Explain
      • Events Table in RCA
      • Feature Analytics Creation
      • Metric Card Creation
      • Performance Charts Creation
      • Performance Charts Visualization
    • Master AI Monitoring: Create, Customize, and Compare Dashboards
      • Creating Dashboards
      • Dashboard Interactions
      • Dashboard Utilities
    • Adding and Editing Models in the UI
      • Model Editor UI
      • Model Schema Editing Guide
    • Fairness
    • Explainability
      • Model: Artifacts, Package, Surrogate
      • Global Explainability: Visualize Feature Impact and Importance in Fiddler
      • Point Explainability
      • Flexible Model Deployment
        • On Prem Manual Flexible Model Deployment XAI
  • Technical Reference
    • Python Client API Reference
    • Python Client Guides
      • Installation and Setup
      • Model Onboarding
        • Create a Project and Onboard a Model for Observation
        • Model Task Types
        • Customizing your Model Schema
        • Specifying Custom Missing Value Representations
      • Publishing Inference Data
        • Creating a Baseline Dataset
        • Publishing Batches Of Events
        • Publishing Ranking Events
        • Streaming Live Events
        • Updating Already Published Events
        • Deleting Events From Fiddler
      • Creating and Managing Alerts
      • Explainability Examples
        • Adding a Surrogate Model
        • Uploading Model Artifacts
        • Updating Model Artifacts
        • ML Framework Examples
          • Scikit Learn
          • Tensorflow HDF5
          • Tensorflow Savedmodel
          • Xgboost
        • Model Task Examples
          • Binary Classification
          • Multiclass Classification
          • Regression
          • Uploading A Ranking Model Artifact
    • Integrations
      • Data Pipeline Integrations
        • Airflow Integration
        • BigQuery Integration
        • Integration With S3
        • Kafka Integration
        • Sagemaker Integration
        • Snowflake Integration
      • ML Platform Integrations
        • Integrate Fiddler with Databricks for Model Monitoring and Explainability
        • Datadog Integration
        • ML Flow Integration
      • Alerting Integrations
        • PagerDuty Integration
    • Comprehensive REST API Reference
      • Projects REST API Guide
      • Model REST API Guide
      • File Upload REST API Guide
      • Custom Metrics REST API Guide
      • Segments REST API Guide
      • Baselines REST API Guide
      • Jobs REST API Guide
      • Alert Rules REST API Guide
      • Environments REST API Guide
      • Explainability REST API Guide
      • Server Info REST API Guide
      • Events REST API Guide
      • Fiddler Trust Service REST API Guide
    • Fiddler Free Guardrails Documentation
  • Configuration Guide
    • Authentication & Authorization
      • Adding Users
      • Overview of Role-Based Access Control
      • Email Authentication
      • Okta OIDC SSO Integration
      • Azure AD OIDC SSO Integration
      • Ping Identity SAML SSO Integration
      • Mapping LDAP Groups & Users to Fiddler Teams
    • Application Settings
    • Supported Browsers
  • History
    • Release Notes
    • Python Client History
    • Compatibility Matrix
    • Product Maturity Definitions
Powered by GitBook

© 2024 Fiddler Labs, Inc.

On this page
  • What is a Project?
  • Onboarding a Model

Was this helpful?

  1. Technical Reference
  2. Python Client Guides
  3. Model Onboarding

Create a Project and Onboard a Model for Observation

PreviousModel OnboardingNextModel Task Types

Last updated 14 days ago

Was this helpful?

What is a Project?

A project helps organize models under observation and serves as the authorization unit to manage access to your models. To onboard a model to Fiddler, you need to have a project to associate it with. Once Fiddler's Python client is connected to your environment, you can either create a new project or use an existing one to onboard your model.

Create a Project

Using the Python client, you can create a project by calling the Project object's create function after setting the desired project name.

# Please be mindful that the Project name must be unique and should not have spaces or special characters.

PROJECT_NAME = 'quickstart_example'

## Create the Project
project = fdl.Project(name=PROJECT_NAME)
project.create()
print(f'New project created with id = {project.id}')

You should now see the newly created project on the Projects page in the Fiddler UI.

List All Projects

Using an existing project, you may list all the projects that you are authorized to view.

for project in fdl.Project.list():
    print(f'Project: {project.id} - {project.name}')

## This will print ALL project IDs and Names that you have access to.

Onboarding a Model

To onboard a model you need to define a ModelSpec and optionally a Model Task. If you do not specify a model task during Model creation it can be set later or left unset.

Define the ModelSpec

A ModelSpec object defines what role each column of your inference data serves in your model.

Fiddler supports five column roles:

  1. Inputs (features),

  2. Outputs (predictions),

  3. Targets (ground truth labels),

  4. Metadata (additional information passed along with the inference)

  5. Custom features (additional information that Fiddler should generate like embeddings or enrichments)

model_spec = fdl.ModelSpec(
    inputs=['CreditScore', 'Geography', 'Gender', 'Age', 'Tenure', 'Balance', 'NumOfProducts', 'HasCrCard', 'IsActiveMember', 'EstimatedSalary'],
    outputs=['probability_churned'],
    targets=['Churned'],
    decisions=[],
    metadata=[],
    custom_features=[],
)

Define the Model Task

model_task = fdl.ModelTask.BINARY_CLASSIFICATION
task_params = fdl.ModelTaskParams(target_class_order=['no', 'yes'])

Infer the Model Schema

Onboard the model schema to Fiddler by passing in:

  1. the data sample dataframe, called sample_df below

  2. the ModelSpec object

  3. the ModelTask and ModelTaskParams objects

  4. the event/inference ID column and event/inference timestamp columns

MODEL_NAME = 'my_model'

model = fdl.Model.from_data(
    name=MODEL_NAME,
    project_id=fdl.Project.from_name(PROJECT_NAME).id,
    source=sample_df,
    spec=model_spec,
    task=model_task,
    task_params=task_params,
    event_id_col=id_column,
    event_ts_col=timestamp_column
)

Depending on the input size this step might take a moment to complete. It is not a local operation, but requires uploading the sample dataframe to the Fiddler HTTP API.

Review and Edit the Schema

Define Model Columns Using Pandas DataFrame Column Types

When defining the columns of a model, use the data types from a Pandas DataFrame. Note that no type inference is performed; it is the responsibility of the user to ensure that the DataFrame's column types are correct. The mapping of column types is as follows:

Pandas
Fiddler (fdl.DataType)

int8

INTEGER

int16

INTEGER

int32

INTEGER

int64

INTEGER

uint8

INTEGER

uint16

INTEGER

uint32

INTEGER

uint64

INTEGER

float16

FLOAT

float32

FLOAT

float64

FLOAT

complex64

STRING

complex128

STRING

string

STRING

object

STRING

bool

BOOLEAN

boolean

BOOLEAN

datetime64[ns]

TIMESTAMP

datetime64[ns, UTC]

TIMESTAMP

timedelta64[ns]

STRING

period[freq]

STRING

category

CATEGORY

interval

STRING

MODEL_NAME = 'my_model'

model_schema = fdl.utils.column_generator.create_columns_from_df(sample_df)

model = fdl.Model(
    name=MODEL_NAME,
    project_id=project.id,
    schema=model_schema,
    spec=model_spec,
    task=model_task,
    task_params=task_params)

The resulting model's schema should be reviewed by the user. Any necessary edits should be made according to the guidelines outlined in the preceding section.

Onboard the Model

After making sure the schema looks good, the model can be onboarded with the following API call:

model.create()

Fiddler supports a variety of model tasks. Create a ModelTask object and an additional ModelTaskParams object to specify the ordering of labels. For a detailed breakdown of all supported model tasks, .

Schema inference is just a helping hand. The resulting schema needs human review and potentially some edits, as documented in the section titled .

Customizing your Model Schema
click here

Need help? Contact us at .

💡
help@fiddler.ai