@@ -19,6 +19,24 @@ def test_registry_loads_persisted_artifacts_after_restart(tmp_path: Path) -> Non
|
||||
assert restarted.load_artifact("model-v1") == artifact
|
||||
|
||||
|
||||
def test_registry_persists_statistical_parameters(tmp_path: Path) -> None:
|
||||
from app.ml.feature_store import FeatureStore, FeatureVector
|
||||
from app.ml.training import TrainingPipeline
|
||||
|
||||
store = FeatureStore()
|
||||
store.add_batch(
|
||||
[
|
||||
FeatureVector("sensor.kitchen", {"temperature": 19.0}),
|
||||
FeatureVector("sensor.kitchen", {"temperature": 20.0}),
|
||||
]
|
||||
)
|
||||
artifact = TrainingPipeline(store).run("model-v1")
|
||||
|
||||
ModelRegistry(tmp_path).register(artifact)
|
||||
|
||||
assert ModelRegistry(tmp_path).load_artifact("model-v1") == artifact
|
||||
|
||||
|
||||
def test_registry_replaces_persisted_artifact_after_restart(tmp_path: Path) -> None:
|
||||
registry = ModelRegistry(tmp_path)
|
||||
registry.register(TrainedArtifact("model-v1", ("sensor.kitchen",)))
|
||||
|
||||
Reference in New Issue
Block a user