The Vectice API enables you to log all models used during development to the Vectice app. To log your model's data and supporting artifacts, use the following Model method to declare your model.
from vectice import Modelmodel =Model(name, library, technique, metrics, predictor, attachments)
Once your model is declared, log the model's artifacts to vectice:
iteration.log(model)
Example
Below is a full example showcasing the concepts mentioned above.
import vecticefrom vectice import Model, Metricfrom sklearn import ...# Connect to Vecticeconnect = vectice.connect(api_token="your-api-key")#Paste your API key# Retrieve the project phase to begin the model development phase = connect.phase("PHA-XXX")# Initialize iterationiteration = phase.create_or_get_current_iteration()# Model artifactsmodel_name ="your-model-name"model_library ="sklearn"model_technique ="clustering"model_metrics = [Metric("RMSE", 153),Metric("Clusters number", 5)]model_predictor = my_sklearn_predictormodel_attachments = ["attachment1.png","attachment2.png" ]# Declaring your model and its artifactsmodel =Model(name=model_name, library=model_library, technique=model_technique, metrics=model_metrics, predictor=model_predictor, attachments=model_attachments)# Log the model to Vecticeiteration.log(model)
For an in-depth example, view the code example found in the Iterative Development guide.