caution
You're viewing docs for the deprecated Fetcher API.
We recommend upgrading to the new Query API.
AttributeFilter
Python package: neptune-fetcher
Filter to apply to attributes when fetching runs or experiments.
Use to select specific metrics or other metadata based on various criteria.
Parameters
Examples
Import the needed classes:
import neptune_fetcher.alpha as npt
from neptune_fetcher.alpha.filters import AttributeFilter
Constructing a filter
Select metrics not matching regexes ^test
or loss$
and pick the "average" and "variance" aggregations:
AttributeFilter(
name_matches_none=[r"^test", r"loss$"],
aggregations=["average", "variance"],
)
Combine multiple filters with the pipe character:
filter_1 = AttributeFilter(...)
filter_2 = AttributeFilter(...)
filter_3 = AttributeFilter(...)
alternatives = filter_1 | filter_2 | filter_3
Using a filter
To use an attribute filter, pass it to the attributes
argument of a fetching or listing method:
npt.fetch_experiments_table(
experiments=["daring-kittiwake_week-41", "discreet-kittiwake_week-42"],
attributes=AttributeFilter(name_eq="configs/learning_rate"),
)
You can also pass a list of attribute names directly to the attributes
argument. Example using the runs API:
from neptune_fetcher.alpha import runs
runs.fetch_runs_table(
runs=["spurious-kittiwake_025c425", "spurious-kittiwake_x56jjh2"],
attributes=["configs/optimizer", "configs/batch_size"],
)