To onboard a model without uploading your model artifact, you can use the client.add_model() Python client. Let's walk through a simple example of how this can be done.
Using client.add_model() does not provide Fiddler with a model artifact. Onboarding a model in this fashion is a good start for model monitoring, but Fiddler will not be able to offer model explainability features without a model artifact. You can subsequently call client.add_model_surrogate() or client.add_model_artifact() to provide Fiddler with a model artifact. Please see Uploading a Model Artifact for more information.
PROJECT_ID = 'example_project' DATASET_ID = 'example_dataset' dataset_info = client.get_dataset_info( project_id=PROJECT_ID, dataset_id=DATASET_ID )
Although the data has been uploaded to Fiddler, there is still no specification for which columns to use for which purpose.
To provide this specification, you can create a fdl.ModelInfo() object.
In this case, we’d like to tell Fiddler to use
output_columnas the model output
target_columnas the model's target/ground truth
model_task = fdl.ModelTask.BINARY_CLASSIFICATION model_target = 'target_column' model_outputs = ['output_column'] model_features = [ 'feature_1', 'feature_2', 'feature_3' ] model_info = fdl.ModelInfo.from_dataset_info( dataset_info=dataset_info, dataset_id=DATASET_ID, features=model_features, target=model_target, outputs=model_outputs, model_task=model_task )
The fdl.ModelInfo.from_dataset_info() function allows you to specify a fdl.DatasetInfo() object along with some extra specification and it will automatically generate your fdl.ModelInfo() object for you.
MODEL_ID = 'example_model' client.add_model( project_id=PROJECT_ID, dataset_id=DATASET_ID, model_id=MODEL_ID, model_info=model_info )
Updated about 2 months ago