Skip to main content
Version: Cloud

Generate a metadata.json

You can generate a metadata.json to provide information about the model and training data, in order to enable features related to monitoring of prediction log data (e.g. drift). More information about the metadata.json can be found in the Repository requirements

An example of how to generate a metadata.json for your model can be found below

from sklearn import datasets
from deeploy.common.functions import generate_metadata
from deeploy.client import Client
from deeploy.enums.metadata import ProblemType

data = datasets.load_iris()
df_train = pd.DataFrame(data=data.data, columns=data.feature_names)

metadata = generate_metadata(df_train, problem_type=ProblemType.CLASSIFICATION)

# Save to a 'metadata.json' file
client = Client(
host="app.deeploy.ml",
workspace_id="b6d8c781-2526-4e03-9b43-example",
access_key="DPAexample",
secret_key="example",
)
client.generate_metadata_json("./directory/", metadata)