A developer guide for creating and managing model directories.
Client
Create a model
model = client.create_model(
name="<model_name>",
ontology_id="<ontology_id>"
)
Get a model
model = client.get_model("<model_id>")
# from labelbox import Model
models = client.get_models(where=(Model.name == "<model_name>"))
Methods
Create a model run
model.create_model_run(name="<model_run_name>"
# optionally, you can supply details of the model run config
model.create_model_run(
name="<model_run_with_config>",
config={
"learning_rate": 0.001,
"batch_size": 32
}
)
Delete a model and its model runs
Deleting a model also deletes its model runs.
This action is permanent; it cannot be undone or rolled back.
model.delete()
Attributes
Get the basics
# name (str)
model.name
Get the model runs
# get the model runs (relationship to ModelRun objects)
model_runs = model.model_runs()
# inspect one model run
next(model_runs)
# inspect all model runs
for model_run in model_runs:
print(model_run)