harden delivery pipeline and production runtime
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
"""Machine-Learning-Grundbausteine für SillyHome Next."""
|
||||
__all__ = ["FeatureStore", "FeatureVector"]
|
||||
__all__ = ["FeatureStore", "FeatureVector", "TrainedArtifact", "TrainingPipeline"]
|
||||
from app.ml.feature_store import FeatureStore, FeatureVector
|
||||
from app.ml.training import TrainedArtifact, TrainingPipeline
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import defaultdict
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Iterable
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -28,4 +28,4 @@ class FeatureStore:
|
||||
return series[-1] if series else None
|
||||
|
||||
def all(self) -> list[FeatureVector]:
|
||||
return [vector for vectors in self._vectors.values() for vector in vectors]
|
||||
return [vector for vectors in self._vectors.values() for vector in vectors]
|
||||
|
||||
@@ -23,8 +23,8 @@ class ModelRegistry:
|
||||
|
||||
def register(self, artifact: TrainedArtifact) -> TrainedArtifact:
|
||||
self._validate_artifact_id(artifact.artifact_id)
|
||||
self._artifacts[artifact.artifact_id] = artifact
|
||||
self._persist(artifact)
|
||||
self._artifacts[artifact.artifact_id] = artifact
|
||||
return artifact
|
||||
|
||||
def load_artifact(self, artifact_id: str) -> TrainedArtifact:
|
||||
|
||||
@@ -2,9 +2,8 @@ from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence
|
||||
|
||||
from app.ml.feature_store import FeatureVector, FeatureStore
|
||||
from app.ml.feature_store import FeatureStore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -34,4 +33,4 @@ class TrainingPipeline:
|
||||
def export(self, artifact_id: str) -> TrainedArtifact:
|
||||
if artifact_id not in self._artifacts:
|
||||
raise KeyError(f"Artifact '{artifact_id}' nicht gefunden.")
|
||||
return self._artifacts[artifact_id]
|
||||
return self._artifacts[artifact_id]
|
||||
|
||||
Reference in New Issue
Block a user