API Methods 3.x

Alerts

AlertRule

AlertRule object contains the below fields.

constructor()

Initialize a new AlertRule on Fiddler Platform.

Parameters

Usage

MODEL_NAME = 'test_model'
PROJECT_NAME = 'test_project'
BASELINE_NAME = 'test_baseline'
SEGMENT_NAME = 'test_segment'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
baseline = fdl.Baseline.from_name(name=BASELINE_NAME, model_id=model.id)
segment = fdl.Segment.from_name(name=SEGMENT_NAME, model_id=model.id)

alert_rule = fdl.AlertRule(
    name='Bank Churn Drift Hawaii Region',
    model_id=model.id,
    baseline_id=baseline.id,
    metric_id='jsd',
    priority=fdl.Priority.HIGH,
    compare_to=fdl.CompareTo.TIME_PERIOD,
    compare_bin_delta=1,
    condition=fdl.AlertCondition.GREATER,
    bin_size=fdl.BinSize.DAY,
    critical_threshold=0.5,
    warning_threshold=0.1,
    columns=['gender', 'creditscore'],
    segment_id=segment.id,
    evaluation_delay=1
)

create()

Create a new AlertRule.

Parameters

No

Usage

MODEL_NAME = 'test_model'
PROJECT_NAME = 'test_project'
BASELINE_NAME = 'test_baseline'
SEGMENT_NAME = 'test_segment'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
baseline = fdl.Baseline.from_name(name=BASELINE_NAME, model_id=model.id)
segment = fdl.Segment.from_name(name=SEGMENT_NAME, model_id=model.id)

alert_rule = fdl.AlertRule(
    name='Bank Churn Drift Hawaii Region',
    model_id=model.id,
    baseline_id=baseline.id,
    metric_id='jsd',
    priority=fdl.Priority.HIGH,
    compare_to=fdl.CompareTo.TIME_PERIOD,
    compare_bin_delta=1,
    condition=fdl.AlertCondition.GREATER,
    bin_size=fdl.BinSize.DAY,
    critical_threshold=0.5,
    warning_threshold=0.1,
    columns=['gender', 'creditscore'],
    segment_id=segment.id,
    evaluation_delay=1
).create()

Returns

get()

Get a single AlertRule.

Parameters

Usage

ALERT_RULE_ID='ed8f18e6-c319-4374-8884-71126a6bab85'

alert = fdl.AlertRule.get(id_=ALERT_RULE_ID)

Returns

Raises


list()

Get a list of AlertRules .

Parameters

Usage

MODEL_ID = '299c7b40-b87c-4dad-bb94-251dbcd3cbdf'

alerts = fdl.AlertRule.list(model_id=MODEL_ID)

Returns


delete()

Delete an existing AlertRule.

Parameters

Usage

MODEL_ID = '299c7b40-b87c-4dad-bb94-251dbcd3cbdf'
ALERT_RULE_NAME = 'Testing Alert API'

alert_rules = fdl.AlertRule.list(model_id=MODEL_ID)

for alert_rule in alert_rules: 
    if alert_rule.name == ALERT_RULE_NAME: 
        alert_rule.delete()
        break

Returns

No

Raises


enable_notifications()

Enable an AlertRule's notification.

Parameters

Usage

ALERT_NAME = "YOUR_ALERT_NAME"
MODEL_ID = '299c7b40-b87c-4dad-bb94-251dbcd3cbdf'

alerts_list = fdl.AlertRule.list(model_id=MODEL_ID)
for alert_rule in alerts_list:
    if ALERT_NAME == alert.name:
        alert_rule.enable_notifications()
        break

Returns

None

Raises


disable_notifications()

Disable notifications for an AlertRule.

Parameters

Usage

ALERT_NAME = "YOUR_ALERT_NAME"
MODEL_ID = '299c7b40-b87c-4dad-bb94-251dbcd3cbdf'

alerts_list = fdl.AlertRule.list(model_id=MODEL_ID)
for alert_rule in alerts_list:
    if ALERT_NAME == alert.name:
        alert_rule.disable_notifications()

Returns

None

Raises


Alert Notifications

Alert notifications for an AlertRule.

set_notification_config()

Set NotificationConfig for an AlertRule.

Parameters

Usage

ALERT_RULE_ID = '72e8835b-cde2-4dd2-a435-a35d4b51196b'
rule = fdl.AlertRule.get(id_=ALERT_RULE_ID)

rule.set_notification_config(
  emails=['abc@xyz.com', 'admin@xyz.com'],
  webhooks=['8b403d99-530a-4c5a-a519-89688d65ddc1'], # Webhook UUID 
  pagerduty_services = ['pagerduty_service_1','pagerduty_service_2'], # PagerDuty service names
  pagerduty_severity = 'critical' # Only applies to PagerDuty, ignored otherwise 
)

Returns

If pagerduty_severity is passed without specifying pagerduty_services then the pagerduty_severity is ignored.

Raises

get_notification_config()

Get notification configuration for an AlertRule.

Parameters

None

Usage

ALERT_RULE_ID = '72e8835b-cde2-4dd2-a435-a35d4b51196b'
rule = fdl.AlertRule.get(id_=ALERT_RULE_ID)

rule.get_notification_config()

Returns

Raises


Triggered Alerts

AlertRecord

An AlertRecord details an AlertRule's triggered alert.

list()

List AlertRecords triggered for an AlertRule.

Parameters

Usage

ALERT_NAME = "YOUR_ALERT_NAME"
MODEL_ID = '299c7b40-b87c-4dad-bb94-251dbcd3cbdf'
triggered_alerts = None

alerts_list = fdl.AlertRule.list(model_id=MODEL_ID)
for alert_rule in alerts_list:
    if ALERT_NAME == alert.name:
        triggered_alerts = fdl.AlertRecord.list(
            alert_rule_id=ALERT_RULE_ID,
            start_time=datetime(2024, 9, 1), # optional
            end_time=datetime(2024, 9, 24), # optional 
            ordering = ['alert_time_bucket'], # ['-alert_time_bucket'] for descending sort, optional.
        )

Returns


Baselines

Baseline datasets are used for making comparisons with production data.

A baseline dataset should be sampled from your model's training set, so it can serve as a representation of what the model expects to see in production.

Baseline

Baseline object contains the below fields.

constructor()

Initialize a new baseline instance.

Parameters

Usage

BASELINE_NAME = 'YOUR_BASELINE_NAME'
PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'
DATASET_NAME = 'YOUR_DATASET_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
dataset = fdl.Dataset.from_name(name=DATASET_NAME, model_id=model.id)

baseline = fdl.Baseline(
        name=BASELINE_NAME,
        model_id=model.id,
        environment=fdl.EnvType.PRE_PRODUCTION,
        dataset_id=dataset.id,
        type_=fdl.BaselineType.STATIC,
    )

create()

Adds a baseline to Fiddler.

Parameters

No

Usage

BASELINE_NAME = 'YOUR_BASELINE_NAME'
PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'
DATASET_NAME = 'YOUR_DATASET_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
dataset = fdl.Dataset.from_name(name=DATASET_NAME, model_id=model.id)

baseline = fdl.Baseline(
        name=BASELINE_NAME,
        model_id=model.id,
        environment=fdl.EnvType.PRE_PRODUCTION,
        dataset_id=dataset.id,
        type_=fdl.BaselineType.STATIC,
    ).create()

Returns

Raises

get()

Get baseline from Fiddler Platform based on UUID.

Parameters

Usage

BASELINE_ID = 'af05646f-0cef-4638-84c9-0d195df2575d'
baseline = fdl.Baseline.get(id_=BASELINE_ID)

Returns

Raises


from_name()

Get baseline from Fiddler Platform based on name.

Parameters

Usage

BASELINE_NAME = 'YOUR_BASELINE_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

baseline = fdl.Baseline.from_name(
    name=BASELINE_NAME,
    model_id=MODEL_ID
)

Returns

Raises


list()

List all baselines accessible to user.

Parameters

Usage

MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'
baselines = fdl.Baseline.list(model_id=MODEL_ID)

Returns

Raises


delete()

Deletes a baseline.

Parameters

Usage

BASELINE_NAME = 'YOUR_BASELINE_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

baseline = fdl.Baseline.from_name(name=BASELINE_NAME, model_id=MODEL_ID)
baseline.delete()

Returns

None

Raises


Custom Metrics

User-defined metrics to extend Fiddler's built-in metrics.

CustomMetric

CustomMetric object contains the below parameters.

constructor()

Initialise a new custom metric.

Parameters

Usage

METRIC_NAME = 'YOUR_CUSTOM_METRIC_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

metric = fdl.CustomMetric(
    name=METRIC_NAME,
    model_id=MODEL_ID,
    definition="average(if(\"spend_amount\">1000, \"spend_amount\", 0))", #Use Fiddler Query Languge (FQL) to define your custom metrics
    description='Get average spend for users spending over $1000',
)

get()

Get CustomMetric from Fiddler Platform based on model UUID.

Parameters

Usage

MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

metrics = fdl.CustomMetric.list(model_id=MODEL_ID)

Returns

Raises

from_name()

Get CustomMetric from Fiddler Platform based on name and model UUID.

Parameters

Usage

METRIC_NAME = 'YOUR_CUSTOM_METRIC_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

metric = fdl.CustomMetric.from_name(
    name=METRIC_NAME,
    model_id=MODEL_ID
)

Returns

Raises

create()

Creates a custom metric for a model on Fiddler Platform.

Parameters

None

Usage

METRIC_NAME = 'YOUR_CUSTOM_METRIC_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

metric = fdl.CustomMetric(
    name=METRIC_NAME,
    model_id=MODEL_ID,
    definition="average(if(\"spend_amount\">1000, \"spend_amount\", 0))", #Use Fiddler Query Languge (FQL) to define your custom metrics
    description='Get average spend for users spending over $1000',
).create()

Returns

Raises

delete()

Delete a custom metric.

Parameters

Usage

METRIC_NAME = 'YOUR_CUSTOM_METRIC_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

metric = fdl.CustomMetric.from_name(name=METRIC_NAME, model_id=MODEL_ID)
metric.delete()

Returns

No

Raises


Datasets

Datasets (or baseline datasets) are used for making comparisons with production data.


Dataset

Dataset object contains the below parameters.


get()

Get dataset from Fiddler Platform based on UUID.

Parameters

Usage

DATASET_ID = 'ba6ec4e4-7188-44c5-ba84-c2cb22b4bb00'
dataset = fdl.Dataset.get(id_=DATASET_ID)

Returns

Raises


from_name()

Get dataset from Fiddler Platform based on name and model UUID.

Usage params

Usage

DATASET_NAME = 'YOUR_DATASET_NAME'
MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

dataset = fdl.Dataset.from_name(
    name=DATASET_NAME,
    model_id=MODEL_ID
)

Returns

Raises


list()

Get a list of all datasets associated to a model.

Parameters

Usage

MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'

datasets = fdl.Dataset.list(model_id=MODEL_ID)

Returns

Raises


Jobs

A Job is used to track asynchronous processes such as batch publising of data.

Job

Job object contains the below fields.

get()

Get the job instance using job UUID.

Parameters

Usage

JOB_ID = '1531bfd9-2ca2-4a7b-bb5a-136c8da09ca1'
job = fdl.Job.get(id_=JOB_ID)

Returns

Raises


wait()

Wait for job to complete either with success or failure status.

Parameters

Usage

JOB_ID = '1531bfd9-2ca2-4a7b-bb5a-136c8da09ca1'
job = fdl.Job.get(id_=JOB_ID)
job.wait()

Returns

Raises

watch()

Watch job status at given interval and yield job object.

Parameters

Usage

JOB_ID = "69f846db-5aac-44fe-9fa5-14f40048e4b2"
job = fdl.Job.get(id_=JOB_ID)

for ijob in job.watch(interval=30, timeout=1200):
    print(f'Status: {ijob.status} - progress: {ijob.progress}')

Returns

Raises


Models

A Model is a representation of your machine learning model which can be used for monitoring, explainability, and more. You do not need to upload your model artifact in order to onboard your model, but doing so will significantly improve the quality of explanations generated by Fiddler.

Model

Model object contains the below parameters.

constructor()

Initialize a new model instance.

Parameters

from_data()

Build model instance from the given dataframe or file(csv/parquet).

Parameters

Usage

MODEL_NAME = 'example_model'
PROJECT_ID = '1531bfd9-2ca2-4a7b-bb5a-136c8da09ca1'
MODEL_SPEC = {
  'custom_features': [],
  'decisions': ['Decisions'],
  'inputs': [
    'CreditScore',
    'Geography',
  ],
  'metadata': [],
  'outputs': ['probability_churned'],
  'schema_version': 1,
  'targets': ['Churned'],
}

# Without version
model = fdl.Model.from_data(
  source=<file_path>,
  name=MODEL_NAME,
  project_id=PROJECT_ID,
  spec=fdl.ModelSpec(**MODEL_SPEC),
)

# With version
model = fdl.Model.from_data(
  source=<file_path>,
  name=MODEL_NAME,
  version='v2',
  project_id=PROJECT_ID,
  spec=fdl.ModelSpec(**MODEL_SPEC),
)

Returns

Notes

  • from_data will not create a model entry on Fiddler Platform. Instead this method only returns a model instance which can be edited, call .create() to onboard the model to Fiddler Platform.

  • spec is optional to from_data method. However, a spec with at least inputs is required for model onboarding.

  • Make sure spec is passed to from_data method if model requires custom features. This method generates centroids which are needed for custom feature drift computation

  • If version is not explicitly passed, Fiddler Platform will treat it as v1 version of the model.

create()

Onboard a new model to Fiddler Platform

Parameters

No

Usage

model = fdl.Model.from_data(...)
model.create()

Returns

Raises

get()

Get model from Fiddler Platform based on UUID.

Parameters

Returns

Raises

Usage

MODEL_ID = '4531bfd9-2ca2-4a7b-bb5a-136c8da09ca2'
model = fdl.Model.get(id_=MODEL_ID)

from_name()

Get model from Fiddler Platform based on name and project UUID.

Parameters

version parameter is available from fiddler-client==3.1 onwards

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'

PROJECT = fdl.Project.from_name(name=PROJECT_NAME)

# Without version
MODEL = fdl.Model.from_name(name=MODEL_NAME, project_id=PROJECT.id)

# With version
MODEL = fdl.Model.from_name(name=MODEL_NAME, project_id=PROJECT.id, version='v2')

Returns

Notes

  • When the version is not passed, then the model created without any version will be fetched. Fiddler internally assigns version=v1 when not passed.

  • When the version is passed, method will fetch the model corresponding to that specific version.

Raises

list()

Gets all models of a project.

Parameters

Returns

Errors

Usage example

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)

models = fdl.Model.list(project_id=project.id)

Notes

Since Model contains a lot of information, list operations does not return all the fields of a model. Instead this method returns ModelCompact objects on which .fetch() can be called to get the complete Model instance. For most of the use-cases, ModelCompact objects are sufficient.

update()

Update an existing model. Only following fields are allowed to be updated, backend will ignore if any other field is updated on the instance.

Parameters

version parameter is available from fiddler-client==3.1 onwards

Usage

model.description = 'YOUR_MODEL_DESCRIPTION'
model.update()

Returns

No

Raises

duplicate()

Duplicate the model instance with the given version name.

This call will not save the model on Fiddler Platform. After making changes to the model instance, call .create() to add the model version to Fiddler Platform.

This method is available from fiddler-client==3.1 onwards.

Parameters

Usage

PROJECT_ID = '1531bfd9-2ca2-4a7b-bb5a-136c8da09ca1'
MODEL_NAME = 'test_model'

model = Model.from_name(name=MODEL_NAME, project_id=PROJECT_ID, version='v3')
new_model = model.duplicate(version='v4')
new_model.schema['Age'].min = 18
new_model.schema['Age'].max = 60

new_model.create()

Returns

No

Raises

delete()

Delete a model.

Parameters

No

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)

job = model.delete()
job.wait()

Returns

Notes

Model deletion is an async process, hence a job object is returned on delete() call. Call job.wait() to wait for the job to complete. If you are planning to create a model with the same name, please wait for the job to complete, otherwise backend will not allow new model with same name.

add_surrogate()

Add surrogate existing model.

Parameters

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'
DATASET_NAME = 'YOUR_DATASET_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
dataset = fdl.Dataset.from_name(name=DATASET_NAME, model_id=model.id)

DEPLOYMENT_PARAMS = {'memory': 1024, 'cpu': 1000}

model.add_surrogate(
  dataset_id=dataset.id,
  deployment_params=fdl.DeploymentParams(**DEPLOYMENT_PARAMS)
)

Returns

Raises

update_surrogate()

Update surrogate existing model.

Parameters

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'
DATASET_NAME = 'YOUR_DATASET_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)
dataset = fdl.Dataset.from_name(name=DATASET_NAME, model_id=model.id)

DEPLOYMENT_PARAMS = {'memory': 1024, 'cpu': 1000}

model.update_surrogate(
  dataset_id=dataset.id,
  deployment_params=fdl.DeploymentParams(**DEPLOYMENT_PARAMS)
)

Returns

add_artifact()

Add artifact files to existing model.

Parameters

Usage

MODEL_DIR = 'PATH_TO_MODEL_DIRECTORY'
DEPLOYMENT_PARAMS = {'memory': 1024, 'cpu': 1000}

model.add_artifact(
  model_dir=MODEL_DIR,
  deployment_params=fdl.DeploymentParams(**DEPLOYMENT_PARAMS)
)

Returns

update_artifact()

Update existing artifact files in a model.

Parameters

Usage

MODEL_DIR = 'PATH_TO_MODEL_DIRECTORY'
DEPLOYMENT_PARAMS = {'memory': 1024, 'cpu': 1000}

model.update_artifact(
  model_dir=MODEL_DIR,
  deployment_params=fdl.DeploymentParams(**DEPLOYMENT_PARAMS)
)

Returns

download_artifact()

Download existing artifact files in a model.

Parameters

Usage

OUTPUT_DIR = 'PATH_TO_TARGET_DIRECTORY'
model.download_artifact(output_dir=OUTPUT_DIR)

Returns

No

Properties

datasets

List all datasets associated with a model.

Parameters

No

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)

model.datasets

Returns

Raises

model_deployment

Get the model deployment object associated with the model.

Parameters

No

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
MODEL_NAME = 'YOUR_MODEL_NAME'

project = fdl.Project.from_name(name=PROJECT_NAME)
model = fdl.Model.from_name(name=MODEL_NAME, project_id=project.id)

model.model_deployment

Returns

Raises

publish()

Publish Pre-production or production events.

Parameters

Usage

Pre-requisite

# Before publishing, make sure you set up the necessary fields of the model(if any).
# If you set the fields to non-empty value, We expect them passed in the source.
model.event_ts_col = 'timestamp'
model.event_id_col = 'event_id'
model.update()

Publish dataset (pre-production data) from file

# Publish File
FILE_PATH = 'PATH_TO_DATASET_FILE'
job = model.publish(
  source=FILE_PATH,
  environment=fdl.EnvType.PRE_PRODUCTION,
  dataset_name='training_dataset'
)
job.wait()

Publish dataset (pre-production data) from dataframe

df = pd.DataFrame(np.random.randint(0, 100, size=(10, 4)), columns=list('ABCD'))
job = model.publish(
  source=df,
  environment=fdl.EnvType.PRE_PRODUCTION,
  dataset_name='training_dataset'
)
job.wait()

Publish production events from list

List is only supported for production data but not for pre-production.

Events are published as a stream. This mode is recommended If you have a high volume of continuous real-time traffic of events, as it allows for more efficient processing on our backend.

It returns a list of event_id for each of the published events.

# Publish list of dictionary objects
events = [
  {'A': 56, 'B': 68, 'C': 67, 'D': 27, 'event_id': 'A1', 'timestamp':'2024-05-01 00:00:00'},
  {'A': 43, 'B': 59, 'C': 64, 'D': 18, 'event_id': 'A2', 'timestamp':'2024-05-01 00:00:00'},
  ...
]
event_ids = model.publish(
  source=events,
  environment=fdl.EnvType.PRODUCTION
)

Notes

In this example where model.event_id_col=event_id, we expect event_id as the required key of the dictionary. Otherwise if you keep model.event_id_col=None, our backend will generate unique event ids and return these back to you. Same for model.event_ts_col, we assign current time as event timestamp in case of None.

Publish production events from file

Batch events is faster if you want to publish a large-scale set of historical data.

# Publish File
FILE_PATH = 'PATH_TO_EVENTS_FILE'
job = model.publish(
  source=FILE_PATH,
  environment=fdl.EnvType.PRODUCTION,
)
job.wait()

Publish production events from dataframe

df = pd.DataFrame(
    {
        'A': np.random.randint(0, 100, size=(2)),
        'B': np.random.randint(0, 100, size=(2)),
        'C': np.random.randint(0, 100, size=(2)),
        'D': np.random.randint(0, 100, size=(2)),
        'timestamp': [time.time()]*2,  # optional model.event_ts_col
        'event_id': ['A1', 'A2'],      # optional model.event_id_col
    }
)
event_ids = model.publish(
  source=df,
  environment=fdl.EnvType.PRODUCTION,
)

Update events

if you need to update the target or metadata columns for a previously published production event, set update=True. For more details please refer to Updating Events. Note only production events can be updated.

Update production events from list

events_update = [
    {
        'A': [0],                   # suppose 'A' is the target
        'B': [0],                   # suppose 'B' is the medadata
        'event_id': ['A1'],         # required model.event_id_col
    },
    {
        'A': [1],                   # suppose 'A' is the target
        'B': [1],                   # suppose 'B' is the medadata
        'event_id': ['A2'],         # required model.event_id_col
    },
]
event_ids = model.publish(
  source=events_update,
  environment=fdl.EnvType.PRODUCTION,
  update=True,
)

Update production events from dataframe

df_update = pd.DataFrame(
    {
        'A': [0, 1],                   # suppose 'A' is the target
        'B': [0, 1],                   # suppose 'B' is the medadata
        'event_id': ['A1', 'A2'],      # required model.event_id_col
    }
)
event_ids = model.publish(
  source=df_update,
  environment=fdl.EnvType.PRODUCTION,
  update=True,
)

Returns

In case of streaming publish

In case of batch publish

Model Compact

Model object contains the below parameters.

fetch()

Fetch the model instance from Fiddler Platform.

Parameters

No

Returns

Raises


Model deployment

Get model deployment object of a particular model.

Model deployment:

Model deployment object contains the below parameters.


Update model deployment

Update an existing model deployment.

Parameters

Usage

# Update CPU allocation and activate the model pod
model_id = 'a920ddb6-edb7-473b-a5f7-035f91e1d53a'
model = fdl.Model.get(model_id)
model_deployment = model.deployment
model_deployment.cpu = 300
model_deployment.active = True
model_deployment.update()

Returns

No

Raises


Organizations

Organization in which all the projects, models are present.


Organization:

Organization object contains the below parameters.


Projects

Projects are used to organize your models and datasets. Each project can represent a machine learning task (e.g. predicting house prices, assessing creditworthiness, or detecting fraud).

A project can contain one or more models (e.g. lin_reg_house_predict, random_forest_house_predict).


Project

Project object contains the below parameters.

create()

Creates a project using the specified name.

Parameters

Usage

PROJECT_NAME = 'bank_churn'
project = fdl.Project(name=PROJECT_NAME)
project.create()

Returns

Raises

get()

Get project from Fiddler Platform based on UUID.

Parameters

Usage

PROJECT_ID = '1531bfd9-2ca2-4a7b-bb5a-136c8da09ca1'
project = fdl.Project.get(id_=PROJECT_ID)

Returns

Raises

from_name()

Get project from Fiddler Platform based on name.

Parameters

Usage

PROJECT_NAME = 'YOUR_PROJECT_NAME'
project = fdl.Project.from_name(name=PROJECT_NAME)

Returns

Raises

list()

Gets all projects in an organization.

Parameters

No

Returns