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 non-failed trial with the lowest cost score, 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.The
fronttrial at max perpendicular distance to the chord.Always
None: the journal owns no native importance model.The non-dominated trials by their
objectivessidecar (plan §0a).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
- best() Trial | None[source]#
The non-failed trial with the lowest cost score, 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() list[Trial][source]#
The non-dominated trials by their
objectivessidecar (plan §0a).Delegates to the store-agnostic
pareto_front_of()over the journaled trials. A single-objective journal (no trial carriesobjectives) returns[]while scalarbest()still works.
- knee_point(front: list[Trial]) Trial | None[source]#
The
fronttrial at max perpendicular distance to the chord.Delegates to the store-agnostic
knee_point_of();Nonefor an empty front.
- 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: