API Methods 3.x
Alerts
AlertRule
AlertRule object contains the below fields.
id
UUID
-
Unique identifier of the AlertRule.
name
str
-
Unique name of the AlertRule.
model
-
The associated model details.
project
-
The associated project details
baseline
None
The associated baseline.
segment
None
Details of segment for the alert.
priority
-
To set the priority for the AlertRule. Select from: 1. Priority.LOW 2. Priority.MEDIUM 3. Priority.HIGH.
compare_to
-
Select from the two: 1. CompareTo.RAW_VALUE 2. CompareTo.TIME_PERIOD
metric_id
Union[str, UUID]
-
critical_threshold
float
-
Critical alert is triggered when this value satisfies the condition to the selected metric_id.
condition
-
Select from: 1. AlertCondition.LESSER 2. AlertCondition.GREATER
bin_size
-
Bin size for example fdl.BinSize.HOUR.
columns
Optional[List[str]]
None
List of 1 or more column names for the rule to evaluate. Use ['__ANY__'] to evaluate all columns.
baseline_id
Optional[UUID]
None
UUID of the baseline for the alert.
segment_id
Optional[UUID]
None
UUID of segment for the alert
compare_bin_delta
Optional[int]
None
Indicates previous period for comparison e.g. for fdl.BinSize.DAY, compare_bin_delta=1 will compare 1 day back, compare_bin_delta=7 will compare 7 days back.
warning_threshold
Optional[float]
None
Warning alert is triggered when this value satisfies the condition to the selected metric_id.
created_at
datetime
-
The creation timestamp.
updated_at
datetime
-
The timestamp of most recent update.
evaluation_delay
int
0
Specifies a delay in hours before AlertRule is evaluated. The delay period must not exceed one year(8760 hours).
constructor()
Initialize a new AlertRule on Fiddler Platform.
Parameters
name
str
-
Unique name of the model
model_id
UUID
-
Details of the model.
metric_id
Union[str, UUID]
-
Type of alert metric UUID or enum.
columns
Optional[List[str]]
None
List of column names on which AlertRule is to be created. It can take ['__ANY__'] to check for all columns.
baseline_id
Optional[UUID]
None
UUID of the baseline for the alert.
segment_id
Optional[UUID]
None
UUID of the segment for the alert.
priority
-
To set the priority for the AlertRule. Select from: 1. Priority.LOW 2. Priority.MEDIUM 3. Priority.HIGH.
compare_to
-
Select from the two: 1. CompareTo.RAW_VALUE (absolute alert) 2. CompareTo.TIME_PERIOD (relative alert)
compare_bin_delta
Optional[int]
None
Compare the metric to a previous time period in units of bin_size.
warning_threshold
Optional[float]
None
Threshold value to crossing which a warning level severity alert will be triggered.
critical_threshold
float
-
Threshold value to crossing which a critical level severity alert will be triggered.
condition
-
Select from: 1. AlertCondition.LESSER 2. AlertCondition.GREATER
bin_size
-
Size of the bin for AlertRule.
evaluation_delay
int
0
To introduce a delay in the evaluation of the alert, specifying the duration in hours. The delay period must not exceed one year(8760 hours).
Usage
create()
Create a new AlertRule.
Parameters
No
Usage
Returns
AlertRule instance.
get()
Get a single AlertRule.
Parameters
id_
UUID
-
Unique identifier for the AlertRule.
Usage
Returns
AlertRule instance.
Raises
NotFound
AlertRule with given identifier not found.
Forbidden
Current user may not have permission to view details of AlertRule.
list()
Get a list of AlertRules .
Parameters
model_id
Union[str, UUID]
None
Unique identifier for the model to which AlertRule belongs.
project_id
Optional[UUID]
None
Unique identifier for the project to which AlertRule belongs
metric_id
Optional[UUID]
None
Type of alert metric UUID or enum.
columns
Optional[List[str]]
None
List of column names on which AlertRule is to be created. It can take ['ANY'] to check for all columns.
baseline_id
Optional[UUID]
None
UUID of the baseline for the AlertRule.
ordering
Optional[List[str]]
None
List of AlertRule fields to order by. Eg. [‘alert_time_bucket’] or [‘- alert_time_bucket’] for descending order.
Usage
Returns
Iterator of AlertRule instances.
delete()
Delete an existing AlertRule.
Parameters
id_
UUID
-
Unique UUID of the AlertRule .
Usage
Returns
No
Raises
NotFound
AlertRule with given identifier not found.
Forbidden
Current user may not have permission to view details of AlertRule.
enable_notifications()
Enable an AlertRule's notification.
Parameters
id_
UUID
-
Unique UUID of the AlertRule .
Usage
Returns
None
Raises
NotFound
AlertRule with given identifier not found.
Forbidden
Current user may not have permission to view details of AlertRule.
disable_notifications()
Disable notifications for an AlertRule.
Parameters
id_
UUID
-
Unique UUID of the AlertRule .
Usage
Returns
None
Raises
NotFound
AlertRule with given identifier not found.
Forbidden
Current user may not have permission to view details of AlertRule.
Alert Notifications
Alert notifications for an AlertRule.
emails
Optional[List[str]]
None
List of emails to send notification to.
PagerDuty_services
Optional[List[str]]
None
List of PagerDuty services to trigger the alert to.
PagerDuty_severity
Optional[str]
None
Severity of PagerDuty.
webhooks
Optional[List[UUID]]
None
set_notification_config()
Set NotificationConfig for an AlertRule.
Parameters
emails
Optional[List[str]]
None
List of emails to send notification to.
PagerDuty_services
Optional[List[str]]
None
List of PagerDuty services to trigger the alert to.
PagerDuty_severity
Optional[str]
None
Severity of PagerDuty.
webhooks
Optional[List[UUID]]
None
Usage
Returns
NotificationConfig
Alert notification settings for an AlertRule.
If
PagerDuty_severity
is passed without specifyingPagerDuty_services
then thePagerDuty_severity
is ignored.
Raises
BadRequest
All 4 input parameters are empty.
ValueError
Webhook ID is incorrect.
get_notification_config()
Get notification configuration for an AlertRule.
Parameters
None
Usage
Returns
NotificationConfig
Alert notification settings for an AlertRule.
Raises
BadRequest
All 4 input parameters are empty.
ValueError
Webhook ID is incorrect.
Triggered Alerts
AlertRecord
An AlertRecord details an AlertRule's triggered alert.
id
UUID
-
Unique identifier for the triggered AlertRule.
alert_rule_id
UUID
-
Unique identifier for the AlertRule which needs to be triggered.
alert_run_start_time
int
-
Timestamp of AlertRule evaluation in epoch.
alert_time_bucket
int
-
Timestamp pointing to the start of the time bucket in epoch.
alert_value
float
-
Value of the metric for alert_time_bucket.
baseline_time_bucket
Optional[int]
None
Timestamp pointing to the start of the baseline time bucket in epoch, only if AlertRule is of 'time period' based comparison.
baseline_value
Optional[float]
None
Value of the metric for baseline_time_bucket.
is_alert
bool
-
Boolean to indicate if alert was supposed to be triggered.
severity
str
-
failure_reason
str
-
String message if there was a failure sending notification.
message
str
-
String message sent as a part of email notification.
feature_name
Optional[str]
None
Name of feature for which alert was triggered.
alert_record_main_version
int
-
Main version of triggered alert record in int, incremented when the value of severity changes.
alert_record_sub_version
int
-
Sub version of triggered alert record in int, incremented when another alert with same severity as before is triggered.
created_at
datetime
-
Time at which trigger AlertRule was created.
updated_at
datetime
-
Latest time at which trigger AlertRule was updated.
list()
List AlertRecords triggered for an AlertRule.
Parameters
alert_rule_id
UUID
-
Unique identifier for the AlertRule which needs to be triggered.
start_time
Optional[datetime]
None
Start time to filter trigger alerts in yyyy-MM-dd format, inclusive.
end_time
Optional[datetime]
None
End time to filter trigger alerts in yyyy-MM-dd format, inclusive.
ordering
Optional[List[str]]
None
List of AlertRule fields to order by. Eg. [‘alert_time_bucket’] or [‘- alert_time_bucket’] for descending order.
Usage
Returns
Iterable of triggered AlertRule instances for an AlertRule.
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.
id
UUID
-
Unique identifier for the baseline.
name
str
-
Baseline name.
type_
-
Baseline type can be static (Pre-production or production) or rolling(production).
start_time
Optional[int]
None
Epoch to be used as start time for STATIC baseline.
end_time
Optional[int]
None
Epoch to be used as end time for STATIC baseline.
offset
Optional[int]
None
Offset in seconds relative to current time to be used for ROLLING baseline.
window_size
Optional[int]
None
Span of window in seconds to be used for ROLLING baseline.
row_count
Optional[int]
None
Number of rows in baseline.
model
-
Details of the model.
project
-
Details of the project to which the baseline belongs.
dataset
-
Details of the dataset from which baseline is derived.
created_at
datetime
-
Time at which baseline was created.
updated_at
datetime
-
Latest time at which baseline was updated.
constructor()
Initialize a new baseline instance.
Parameters
name
str
-
Unique name of the baseline.
model_id
UUID
-
Unique identifier for the model to add baseline to.
environment
-
Type of environment. Can either be PRE_PRODUCTION or PRODUCTION.
type_
-
Baseline type can be static (pre-production or production) or rolling(production).
dataset_id
Optional[UUID]
None
Unique identifier for the dataset on which the baseline is created.
start_time
Optional[int]
None
Epoch to be used as start time for STATIC baseline.
end_time
Optional[int]
None
Epoch to be used as end time for STATIC baseline.
offset_delta
Optional[int]
None
window_bin_size
Optional[str]
None
Usage
create()
Adds a baseline to Fiddler.
Parameters
No
Usage
Returns
Baseline instance.
Raises
Conflict
Baseline with same name may exist in project .
NotFound
Given dataset may not exist in for the input model.
ValueError
Validation failures like wrong window size, start_time, end_time etc
get()
Get baseline from Fiddler Platform based on UUID.
Parameters
id_
UUID
-
Unique identifier for the baseline.
Usage
Returns
Baseline instance.
Raises
NotFound
Baseline with given identifier not found.
Forbidden
Current user may not have permission to view details of baseline.
from_name()
Get baseline from Fiddler Platform based on name.
Parameters
name
str
-
Name of the baseline.
model_id
UUID | str
-
Unique identifier for the model.
Usage
Returns
Baseline instance.
Raises
NotFound
Baseline with given identifier not found.
Forbidden
Current user may not have permission to view details of baseline.
list()
List all baselines accessible to user.
Parameters
model_id
UUID
-
UUID of the model associated with baseline.
Usage
Returns
Iterable of all baseline objects.
Raises
Forbidden
Current user may not have permission to view details of baseline.
delete()
Deletes a baseline.
Parameters
id_
UUID
-
Unique UUID of the baseline .
Usage
Returns
None
Raises
NotFound
Baseline with given identifier not found.
Forbidden
Current user may not have permission to delete baseline.
Custom Metrics
User-defined metrics to extend Fiddler's built-in metrics.
CustomMetric
CustomMetric object contains the below parameters.
id
UUID
-
Unique identifier for the custom metric.
name
str
-
Custom metric name.
model_id
UUID
-
UUID of the model in which the custom metric is being added.
definition
str
-
Definition of the custom metric.
description
Optional[str]
None
Description of the custom metric.
created_at
datetime
-
Time of creation of custom metric.
constructor()
Initialize a new custom metric.
Parameters
name
str
-
Custom metric name.
model_id
UUID
-
UUID of the model in which the custom metric is being added.
definition
str
-
Definition of the custom metric.
description
Optional[str]
None
Description of the custom metric.
Usage
get()
Get CustomMetric from Fiddler Platform based on model UUID.
Parameters
model_id
UUID
-
UUID of the model associated with the custom metrics.
Usage
Returns
Iterable of all custom metric objects.
Raises
Forbidden
Current user may not have permission to view details of custom metric.
from_name()
Get CustomMetric from Fiddler Platform based on name and model UUID.
Parameters
name
str
-
Name of the custom metric.
model_id
UUID | str
-
Unique identifier for the model.
Usage
Returns
Custom Metric instance.
Raises
NotFound
Custom metric with given identifier not found.
Forbidden
Current user may not have permission to view details of custom metric.
create()
Creates a custom metric for a model on Fiddler Platform.
Parameters
None
Usage
Returns
Custom Metric instance.
Raises
Conflict
Custom metric with same name may exist in project .
BadRequest
Invalid definition.
NotFound
Given model may not exist.
delete()
Delete a custom metric.
Parameters
id_
UUID
-
Unique UUID of the custom metric.
Usage
Returns
No
Raises
NotFound
Custom metric with given identifier not found.
Forbidden
Current user may not have permission to delete custom metric.
Datasets
Datasets (or baseline datasets) are used for making comparisons with production data.
Dataset
Dataset object contains the below parameters.
id
UUID
-
Unique identifier for the dataset.
name
str
-
Dataset name.
row_count
int
None
Number of rows in dataset.
model_id
-
Unique identifier of the associated model
project_id
-
Unique identifier of the associated project
get()
Get dataset from Fiddler Platform based on UUID.
Parameters
id_
UUID
-
Unique identifier for the dataset.
Usage
Returns
Dataset instance.
Raises
NotFound
Dataset with given identifier not found.
Forbidden
Current user may not have permission to view details of dataset.
from_name()
Get dataset from Fiddler Platform based on name and model UUID.
Usage params
name
str
-
Name of the dataset.
model_id
UUID | str
-
Unique identifier for the model.
Usage
Returns
Dataset instance.
Raises
NotFound
Dataset not found in the given project name.
Forbidden
Current user may not have permission to view details of dataset.
list()
Get a list of all datasets associated to a model.
Parameters
model_id
UUID
-
UUID of the model associated with baseline.
Usage
Returns
Iterable of all dataset objects.
Raises
Forbidden
Current user may not have permission to view details of dataset.
Jobs
A Job is used to track asynchronous processes such as batch publishing of data.
Job
Job object contains the below fields.
id
UUID
-
Unique identifier for the job.
name
str
-
Name of the job.
status
str
-
Current status of job.
progress
float
-
Progress of job completion.
info
dict
-
Dictionary containing resource_type, resource_name, project_name.
error_message
Optional[str]
None
Message for job failure, if any.
error_reason
Optional[str]
None
Reason for job failure, if any.
extras
Optional[dict]
None
Metadata regarding the job.
get()
Get the job instance using job UUID.
Parameters
id_
UUID
-
Unique UUID of the project to which model is associated.
verbose
bool
False
Flag to get extras
metadata about the tasks executed.
Usage
Returns
Single job object for the input params.
Raises
Forbidden
Current user may not have permission to view details of job.
wait()
Wait for job to complete either with success or failure status.
Parameters
interval
Optional[int]
3
Interval in seconds between polling for job status.
timeout
Optional[int]
1800
Timeout in seconds for iterator to stop.
Usage
Returns
Single job object for the input params.
Raises
Forbidden
Current user may not have permission to view details of job.
TimeoutError
When the default time out of 1800 secs.
watch()
Watch job status at given interval and yield job object.
Parameters
interval
Optional[int]
3
Interval in seconds between polling for job status.
timeout
Optional[int]
1800
Timeout in seconds for iterator to stop.
Usage
Returns
Iterator of job objects.
Raises
Forbidden
Current user may not have permission to view details of job.
TimeoutError
When the default time out of 1800 secs.
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.
id
UUID
-
Unique identifier for the model.
name
str
-
Unique name of the model (only alphanumeric and underscores are allowed).
input_type
ModelInputType.TABULAR
Input data type used by the model.
task
ModelTask.NOT_SET
Task the model is designed to address.
task_params
-
Task parameters given to a particular model.
schema
-
Model schema defines the details of each column.
version
Optional[str]
-
Unique version name within a model
spec
-
Model spec defines how model columns are used along with model task.
description
str
-
Description of the model.
event_id_col
str
-
Column containing event id.
event_ts_col
str
-
Column containing event timestamp.
xai_params
-
Explainability parameters of the model.
artifact_status
str
-
Artifact Status of the model.
artifact_files
list[dict]
-
Dictionary containing file details of model artifact.
is_binary_ranking_model
bool
-
created_at
datetime
-
Time at which model was created.
updated_at
datetime
-
Latest time at which model was updated.
created_by
-
Details of the who created the model.
updated_by
-
Details of the who last updated the model.
project
-
Details of the project to which the model belongs.
organization
-
Details of the organization to which the model belongs.
constructor()
Initialize a new model instance.
Usage
Parameters
name
str
-
Unique name of the model
project_id
UUID
-
Unique identifier for the project to which model belongs.
input_type
ModelInputType.TABULAR
Input data type used by the model.
task
ModelTask.NOT_SET
Task the model is designed to address.
schema
-
Model schema defines the details of each column.
spec
-
Model spec defines how model columns are used along with model task.
version
Optional[str]
-
Unique version name within a model
task_params
-
Task parameters given to a particular model.
description
str
-
Description of the model.
event_id_col
str
-
Column containing event id.
event_ts_col
str
-
Column containing event timestamp.
xai_params
-
Explainability parameters of the model.
from_data()
Build model instance from the given dataframe or file(csv/parquet).
Parameters
source
pd.DataFrame | Path | str
-
Pandas dataframe or path to csv/parquet file
name
str
-
Unique name of the model
project_id
UUID | str
-
Unique identifier for the project to which model belongs.
input_type
ModelInputType.TABULAR
Input data type used by the model.
task
ModelTask.NOT_SET
Task the model is designed to address.
spec
-
Model spec defines how model columns are used along with model task.
version
Optional[str]
-
Unique version name within a model
task_params
-
Task parameters given to a particular model.
description
Optional[str]
-
Description of the model.
event_id_col
Optional[str]
-
Column containing event id.
event_ts_col
Optional[str]
-
Column containing event timestamp.
xai_params
-
Explainability parameters of the model.
max_cardinality
Optional[int]
None
Max cardinality to detect categorical columns.
sample_size
Optional[int]
-
No. of samples to use for generating schema.
Usage
Returns
Model instance.
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 tofrom_data
method. However, aspec
with at leastinputs
is required for model onboarding.Make sure
spec
is passed tofrom_data
method if model requires custom features. This method generates centroids which are needed for custom feature drift computationIf
version
is not explicitly passed, Fiddler Platform will treat it asv1
version of the model.
create()
Onboard a new model to Fiddler Platform
Parameters
No
Usage
Returns
Model instance.
Raises
Conflict
Model with same name may exist in project .
get()
Get model from Fiddler Platform based on UUID.
Parameters
id_
UUID | str
-
Unique identifier for the model.
Returns
Model instance.
Raises
NotFound
Model with given identifier not found.
Forbidden
Current user may not have permission to view details of model.
Usage
from_name()
Get model from Fiddler Platform based on name and project UUID.
Parameters
name
str
-
Name of the model.
project_id
UUID | str
-
Unique identifier for the project.
version
Optional[str]
-
Unique version name within a model
version
parameter is available fromfiddler-client==3.1
onwards
Usage
Returns
Model instance.
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
NotFound
Model not found in the given project name.
Forbidden
Current user may not have permission to view details of model.
list()
Gets all models of a project.
Parameters
project_id
UUID | str
-
Unique UUID of the project to which model is associated.
name
Optional[str]
-
Model name. Pass this to fetch all versions of a model.
Returns
Iterable of model compact objects.
Errors
Forbidden
Current user may not have permission to the given project.
Usage example
Notes
Since
Model
contains a lot of information, list operations does not return all the fields of a model. Instead this method returnsModelCompact
objects on which.fetch()
can be called to get the completeModel
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
Optional[str]
None
Model version name
xai_params
None
Explainability parameters of the model.
description
Optional[str]
None
Description of the model.
event_id_col
Optional[str]
None
Column containing event id.
event_ts_col
Optional[str]
None
Column containing event timestamp.
version
parameter is available fromfiddler-client==3.1
onwards
Usage
Returns
No
Raises
BadRequest
If field is not updatable.
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.
Added in version 3.1.0
Parameters
version
Optional[str]
None
Model version name
Usage