NeptuneTracker
Loading an Optuna Study from Neptune:If an Optuna study is logged to Neptune, you can reload it using the
with_id
flag in init_kwargs. The Neptune ID, found in the Experiments tab or
sys namespace, uniquely identifies a run:- Active run ID:
run["sys/id"].fetch() - Custom run ID:
run["sys/custom_run_id"].fetch()Supports both InMemoryStorage and database storage.
log_kwargs controls logging via npt_utils.NeptuneCallback or
log_study_metadata internally, depending on live_stream flag. By
default, Neptune logs plots from optuna.visualizations, which may add
overhead. Customize logging with:plot_update_freq:- Integer
k: Updates plots every k trials. "never": Disables plot logging.
- Integer
log_plot_contour,log_plot_slice, etc.: SetFalseto skip specific plots.
target_names argument.Ancestors
systematica.portfolio.trackers.base.BaseTrackerabc.ABC
Class variables
-
init_kwargs: Dict[str, Any]: Additional arguments forneptune.init_run. -
log_kwargs: Dict[str, Any]: Additional neptune logging arguments. More information in the Neptune documentation -
live_stream: bool: If True, it runs the Optuna parameter live sweep with the callback. Otherwise, log study metadata after the Study is finished. The latest method is generally faster, as it doesn’t log the data live. When called, it logs the same metadata as the callback and accepts the same flags for customization. Defaults toFalse. -
add_configs: Dict[str, Any]: Additional config logs to store in neptune. -
custom_callback: systematica.portfolio.trackers.custom_neptune_ai.NeptuneCallback: Custom callback. If None, uses originalNeptuneCallback. Default toCustomCallback.
Static methods
add
| Name | Type | Default | Description |
|---|---|---|---|
run | neptune.Run | -- | Run. |
logs | tp.Any | -- | Additional items to be stored in neptune. |
remove
| Name | Type | Default | Description |
|---|---|---|---|
run | neptune.Run | -- | Run. |
count_fields
structure is accessible through run.get_structure().
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
structure | tp.Dict[str, tp.Any] | -- | Neptune stucture. Accessible through run.get_structure(). |
| Type | Description |
|---|---|
int | Number of fields. |
Methods
run_context
| Name | Type | Default | Description |
|---|---|---|---|
kwargs | tp.Kwargs | -- | Additional arguments to pass to neptune.init_run (e.g., with_id, mode). |
| Type | Description |
|---|---|
neptune.Run | The initialized Neptune run object. |
run_study
| Name | Type | Default | Description |
|---|---|---|---|
objective | tp.Callable | -- | Objective function. |
create_study_kwargs | dict, optional | -- | Additional arguments for optuna.create_study. |
optimize_kwargs | dict, optional | -- | Additional arguments for study.optimize.` |
| Type | Description |
|---|---|
optuna.Study | The Optuna study object containing optimization results. |

