fetch_metrics()
Fetches a table of metric values per step.
The values are raw, without any aggregation, approximation, or interpolation.
To narrow the results, limit the step range or the number of values from the tail end. You can also define filters for experiments to search or attributes to include.
Fetch experiment metrics
You can filter the results by:
- Experiments: Specify which experiments to search.
- Attributes: Only list attributes that match certain criteria.
Parameters
Example
Fetch losses of two specific experiments from step 1000 onward, including incomplete points:
import neptune_query as nq
nq.fetch_metrics(
experiments=["seagull-week1", "seagull-week2"],
attributes=r"^loss/.*",
step_range=(1000.0, None),
include_point_previews=True,
)
Fetch from runs
To target individual runs by ID instead of experiment name, import the runs API:
import neptune_query.runs as nq_runs
Then call the corresponding querying method and replace the experiments
parameter with runs
:
nq_runs.fetch_metrics(
runs=["prompt-wolf-20250605132116671-2g2r1"], # run ID
attributes=r"^loss/.*",
step_range=(1000.0, None),
include_point_previews=True,
)