Add workspace and project
How to create monitoring workspaces and projects.
To visualize data in the Evidently ML monitoring user interface, you must capture data and model metrics as Evidently JSON
To simplify log organization, you can create a
Workspace. Practically, it defines a directory to store the
snapshots. This directory will serve as a data source for the Evidently Monitoring UI service. By adding a
workspace, you can organize data for individual models.
Refer to the ML Monitoring QuickStart for a complete Python script that shows how to create a workspace and a project and populate it with toy data.
This section explains how to create a local workspace. In this scenario, you generate and store the snapshots on the same machine.
To create a
workspaceand assign a name:
my_workspace = Workspace.create(“evidently_ui_workspace”)
You can pass a
pathparameter to specify the path to a local directory.
You can add a
projecthelps gather all Reports and Test Suites associated with the same task in one place.
projectwill have its dedicated dashboard in the monitoring interface.
To create a project and assign a name:
project = my_workspace.create_project(“project name”)
What to group into one project? If snapshots belong to the same project, you can visualize the data from multiple snapshots on the same dashboard panel. You can create one project per ML model, but this is not a strict rule. For example, you can log the performance of a model deployed in shadow mode to the same project as an active model. Or, you can store data on multiple related models together. In this case, you can use tags to organize them.
You can pass the following parameters to a project:
To save changes made to a project, you must use the method
For instance, after you create a project, add a name and description, and define monitoring panels, you must save the project to record the changes in the workspace.
Once you create a project within a workspace, you can add Reports, Test Suites, or
snapshotsto a project.
Here is how you add a Report and Test Suite to an earlier created project.
When you add a Report or a Test Suite to a project, Evidently will automatically save a
snapshot. There is no need to generate a snapshot explicitly.
If you already generated a snapshot, you can add it as well:
If you want to delete an existing workspace, run the command from the Terminal:
rm -r workspace
Use this command to delete an empty workspace from the interface or a test project.
Note: this command will delete the snapshots stored in the folder. To maintain access to the generated snapshots, you must store them elsewhere.
All available methods in the class Workspace:
create_project(self, name: str, description: Optional[str] = None)
add_project(self, project: ProjectBase)
add_snapshot(self, project_id: Union[str, uuid.UUID], snapshot: Snapshot)
get_project(self, project_id: Union[str, uuid.UUID])
search_project(self, project_name: str)
You can also use a remote
workspace. In this scenario, you can generate the
snapshotslocally and (using the
add_reportcommands) send it to the remote server where you run the Monitoring UI. You can use the remote workspace API to create and manage projects.
To create a remote workspace (UI should be running at this address):
workspace = RemoteWorkspace("http://localhost:8000")
You can pass the following parameters:
The rest of the functionality and methods are the same.
Refer to the service example: