initial commit

This commit is contained in:
Roberto Treviño Cervantes
2026-09-21 10:23:42 -06:00
commit ca9d3ad81f
8 changed files with 128 additions and 0 deletions
View File
+21
View File
@@ -0,0 +1,21 @@
from abc import ABC, abstractmethod
from typing import Any
class ScreeningModel(ABC):
"""Standard train()/predict() interface every screening model implements,
regardless of which of the three data marts (CaCu/CaMa/TEA) it targets.
Implementations are free to pull their own data straight from
`persistance.<domain>` — the same standard repository API WebApi uses —
or accept already-fetched rows from a caller; `data` is intentionally
untyped at this scaffolding stage.
"""
@abstractmethod
def train(self, data: Any = None) -> None:
"""Fit the model, optionally on `data` passed in by the caller."""
@abstractmethod
def predict(self, data: Any) -> Any:
"""Score `data` and return predictions."""
+19
View File
@@ -0,0 +1,19 @@
from typing import Any
from models.base import ScreeningModel
class CaCuModel(ScreeningModel):
"""Scaffold for the CaCu (cervical cancer) screening model.
Can pull its own training data straight from `persistance.cacu`'s
repositories (`paciente_repository`, `citologia_cervical_repository`,
`biopsia_cervical_repository`, ...) or be handed already-fetched rows.
No real model yet — this is interface scaffolding only.
"""
def train(self, data: Any = None) -> None:
raise NotImplementedError("CaCu training is not implemented yet.")
def predict(self, data: Any) -> Any:
raise NotImplementedError("CaCu prediction is not implemented yet.")
+19
View File
@@ -0,0 +1,19 @@
from typing import Any
from models.base import ScreeningModel
class CaMaModel(ScreeningModel):
"""Scaffold for the CaMa (breast cancer) screening model.
Can pull its own training data straight from `persistance.cama`'s
repositories (`paciente_repository`, `mastografia_repository`,
`biopsia_mama_repository`, ...) or be handed already-fetched rows.
No real model yet — this is interface scaffolding only.
"""
def train(self, data: Any = None) -> None:
raise NotImplementedError("CaMa training is not implemented yet.")
def predict(self, data: Any) -> Any:
raise NotImplementedError("CaMa prediction is not implemented yet.")
+19
View File
@@ -0,0 +1,19 @@
from typing import Any
from models.base import ScreeningModel
class TeaModel(ScreeningModel):
"""Scaffold for the TEA (autism spectrum disorder) screening model.
Can pull its own training data straight from `persistance.tea`'s
repositories (`pacientes_repository`, `evaluacion_psicologica_repository`,
...) or be handed already-fetched rows. No real model yet — this is
interface scaffolding only.
"""
def train(self, data: Any = None) -> None:
raise NotImplementedError("TEA training is not implemented yet.")
def predict(self, data: Any) -> Any:
raise NotImplementedError("TEA prediction is not implemented yet.")