phenotypic.tune.JournalStudyStore#
- class phenotypic.tune.JournalStudyStore(trials: list[Trial] | None = None)[source]#
Bases:
objectAn append-only journal of trials with best-tracking + parquet I/O.
The Phase-1 concrete
StudyStorebackend. It resumes by replay (the engine fast-forwards the deterministic strategy past the recorded trials), sois_resumable_in_place()isFalse— distinguishing it from a future OptunaRDBStoragebackend whose own storage reconstructs the sampler state.Methods
Initialize the journal.
Record one completed
trial.The finite COMPLETE trial with the lowest cost, or
None.The number of completed (non-failed) trials; pruned counts as done.
Reload a journal previously written by
to_parquet().Always
False: the journal resumes by deterministic replay.Return the
frontknee using optional fixed scorer axes.Always
None: the journal owns no native importance model.Return finite non-dominated COMPLETE trials on optional fixed axes.
Return every journal entry; this backend has no in-flight records.
One row per trial;
params/terms/objectivesas JSON strings.Write the journal to
pathatomically (creating parent dirs).Attributes
A copy of the journaled trials in order.
- append(trial: Trial) None[source]#
Record one completed
trial.- Parameters:
trial (Trial)
- Return type:
None
- terminal_trials() list[Trial][source]#
Return every journal entry; this backend has no in-flight records.
- best() Trial | None[source]#
The finite COMPLETE trial with the lowest cost, or
None.- Return type:
Trial | None
- is_resumable_in_place() bool[source]#
Always
False: the journal resumes by deterministic replay.- Return type:
- completed_count() int[source]#
The number of completed (non-failed) trials; pruned counts as done.
- Return type:
- param_importances() dict[str, float] | None[source]#
Always
None: the journal owns no native importance model.The screening layer falls back to its RandomForest + permutation estimate over the journaled trials (screening-importance.md §1).
- pareto_front(objective_axes: Sequence[str] | None = None) list[Trial][source]#
Return finite non-dominated COMPLETE trials on optional fixed axes.
- knee_point(front: list[Trial], objective_axes: Sequence[str] | None = None) Trial | None[source]#
Return the
frontknee using optional fixed scorer axes.
- to_dataframe() pandas.DataFrame[source]#
One row per trial;
params/terms/objectivesas JSON strings.objectives_jsonisNonefor single-objective trials (the column holdsnull) andjson.dumps(t.objectives)for multi-objective ones.- Return type:
- to_parquet(path: Path) None[source]#
Write the journal to
pathatomically (creating parent dirs).Writes to a sibling
<path>.tmpfirst, thenos.replace`s it over ``path`()(atomic on POSIX). A killed worker / full disk mid-serialize therefore leaves any pre-existingtrials.parquetintact rather than a truncated file, and the temp is removed on failure so no.tmpdebris lingers. The temp sibling sharespath’s directory so the rename stays on one filesystem (the atomicity precondition).- Parameters:
path (Path)
- Return type:
None
- classmethod from_parquet(path: Path) JournalStudyStore[source]#
Reload a journal previously written by
to_parquet().Reads
objectives_jsondefensively: a legacy Phase-1/2 parquet predating the multi-objective sidecar (plan §0a) has no such column, and a single-objective trial storesnull— both resolve toobjectives=Noneso older journals still load.- Parameters:
path (Path)
- Return type: