Experiments
Track, compare, tag and download experiment results.
Where experiments come from
An experiment records one training attempt. Two things create them: a workflow run (an experiment is created unless the run names an existing one), and the training route POST /models/<project_id>/train.
The training route needs you to be signed in and to own the project. Body fields: name, description, model_type, config, script_path (default scripts/train.py), competition_id and competition_title. It runs the script in a background thread in the project environment and sends the Socket.IO events training_complete and training_progress to the room project_<id>. After a successful run the stored metrics are only {"status": "completed"}. GET /models/<project_id>/list lists the project's models.
Statuses
pending, running, completed, failed and cancelled. A cloned experiment starts as draft. A run still marked running after 2 hours is marked failed when its status is read.
The experiment pages
The web pages are the experiment list, a comparison view, the detail page at /experiments/<id> and a data profile page.
Find experiments
GET /api/v1/experiments needs you to be signed in.
| Parameter | Meaning |
|---|---|
| status | Filter by status. |
| project_id | Only one project. |
| competition_id | Only one competition. |
| search | Up to 200 characters. Matches name, description, model_type and tags. |
| date_from, date_to | ISO dates. The range may be at most 3650 days. |
| sort_by | id, name, status, model_type, created_at, updated_at or competition_score. |
| sort_order | asc or desc. |
| page, per_page | per_page defaults to 20, maximum 100. |
{
"success": true,
"experiments": [],
"total": 0,
"page": 1,
"per_page": 20,
"pages": 0
}
Experiment routes
All routes are under /api/v1 and check that you are signed in.
| Route | What it does |
|---|---|
| GET /experiments/<id> | Read one. Includes up to 20 workflow runs. |
| GET /experiments/<id>/workflow-runs | Runs of this experiment. The limit parameter is 1 to 500, default 20. |
| GET /experiments/<id>/status | Current status. |
| POST /experiments/<id>/cancel | Cancel. If a workflow run is linked, the cancel goes to the run. If the experiment is not running the answer is success false. |
| POST /experiments/cleanup-stuck | Administrators only. Marks runs older than 1 hour as failed. |
| PUT /experiments/<id>/tags | Replace tags. Body {"tags": [...]}. |
| POST /experiments/<id>/tags | Add one tag. Body {"tag": "..."}. |
| DELETE /experiments/<id>/tags/<tag> | Remove a tag. At most 100 tags per experiment, each up to 100 characters. |
| POST /experiments/<id>/favorite | Toggle the favourite mark. |
| POST /experiments/<id>/set-best | Mark as the best experiment. Only completed experiments qualify. Others in the project lose the mark. |
| POST /experiments/<id>/unset-best | Remove the best mark. |
| POST /experiments/<id>/clone | Copy an experiment. |
| PATCH /experiments/<id> | Change name (up to 200 characters), description or notes. |
| DELETE /experiments/<id> | Delete. |
| POST /experiments/bulk-delete | Body {"ids": [...]}, at most 500. |
| POST /experiments/bulk-export | Body {"ids": [...]}, at most 500. |
| POST /experiments/compare | Body {"ids": [...]}, at least 2. Returns experiments, metric_diffs and hyperparam_diffs. |
Downloads
| Route | File |
|---|---|
| GET /experiments/<id>/download-model | The model (pkl). |
| GET /experiments/<id>/download-predictions | Predictions (csv). |
| GET /experiments/<id>/download-logs | Logs (txt). |
| GET /experiments/<id>/download-code | Generated code (py). |
What an experiment record holds
id, project_id, name, description, model_type, model_config, dataset_path, train_size, metrics, model_path, scoring_script_path, workflow_id, workflow_run_id, pipeline_signature, workflow_snapshot_hash, dependency_snapshot, plugin_snapshot, execution_environment_name and mode, runtime_environment_identifier, artifact_manifest, failure_stage, status, error_message, stdout, stderr, training_logs, generated_code, predictions_file_path, hyperparameters, environment_info, notes, data_profile, parent_experiment_id, tags, is_favorite, is_best, competition fields and timestamps.
Competition scores
POST /api/v1/experiments/<id>/scoring-result takes {score, rank} and an X-API-Key header. It stores the competition score and rank on the experiment. The Community server calls it after scoring a submission.