feat: add routed model training pipeline
This commit is contained in:
@@ -6,6 +6,7 @@ from lmpm.training.dataset import (
|
||||
TrainingDataError,
|
||||
load_sqlite_training_dataset,
|
||||
)
|
||||
from lmpm.training.workflow import train_sqlite_database
|
||||
|
||||
MATERIAL_SCHEMA = """
|
||||
CREATE TABLE material_records (
|
||||
@@ -150,3 +151,20 @@ def test_database_without_material_table_raises_expected_error(tmp_path):
|
||||
|
||||
with pytest.raises(TrainingDataError, match="material_records"):
|
||||
load_sqlite_training_dataset(database_path)
|
||||
|
||||
|
||||
def test_sqlite_workflow_trains_and_saves_every_target_model(tmp_path):
|
||||
database_path = create_database(tmp_path)
|
||||
artifact_path = tmp_path / "lmpm.joblib"
|
||||
|
||||
bundle = train_sqlite_database(database_path, artifact_path)
|
||||
|
||||
assert artifact_path.exists()
|
||||
assert set(bundle.models) == {
|
||||
"is_cut_through",
|
||||
"carbonized_edge_width",
|
||||
"etching_depth",
|
||||
"is_fire_smolder",
|
||||
"pattern_clarity_score",
|
||||
"presentation_balance_score",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user