Each domain's jobs name the models a score run takes
This commit is contained in:
@@ -76,7 +76,7 @@ class Scoring(dg.Config):
|
|||||||
def score_models(context: dg.OpExecutionContext, config: Scoring) -> dict:
|
def score_models(context: dg.OpExecutionContext, config: Scoring) -> dict:
|
||||||
"""Each model's champion scores its cohort; then gold's risk tables are rebuilt."""
|
"""Each model's champion scores its cohort; then gold's risk tables are rebuilt."""
|
||||||
jobs = _jobs(config.domain)
|
jobs = _jobs(config.domain)
|
||||||
found = {name: jobs.score(name) for name in config.models or jobs.JOBS.models}
|
found = {name: jobs.score(name) for name in config.models or jobs.JOBS.scored()}
|
||||||
for name, version in found.items():
|
for name, version in found.items():
|
||||||
context.log.info(f"{name}: " + (f"version {version}" if version else "no champion"))
|
context.log.info(f"{name}: " + (f"version {version}" if version else "no champion"))
|
||||||
silver.build([getattr(jobs, "GOLD", f"{config.domain}_risk") + "+"])
|
silver.build([getattr(jobs, "GOLD", f"{config.domain}_risk") + "+"])
|
||||||
|
|||||||
+6
-2
@@ -41,10 +41,14 @@ class Jobs:
|
|||||||
return f"{self.domain}_events"
|
return f"{self.domain}_events"
|
||||||
|
|
||||||
def routine(self) -> list[str]:
|
def routine(self) -> list[str]:
|
||||||
"""The models a train run takes when none is named: all but the slow ones (a score
|
"""The models a train run takes when none is named: all but the slow ones."""
|
||||||
run takes them all: only training is slow)."""
|
|
||||||
return [n for n, s in self.models.items() if not getattr(s, "slow", False)]
|
return [n for n, s in self.models.items() if not getattr(s, "slow", False)]
|
||||||
|
|
||||||
|
def scored(self) -> list[str]:
|
||||||
|
"""The models a score run takes when none is named: all of them (only training is
|
||||||
|
slow)."""
|
||||||
|
return list(self.models)
|
||||||
|
|
||||||
def registered(self, name: str) -> str:
|
def registered(self, name: str) -> str:
|
||||||
return f"{self.domain}.{name}"
|
return f"{self.domain}.{name}"
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ class Jobs:
|
|||||||
def routine(self) -> list[str]:
|
def routine(self) -> list[str]:
|
||||||
return list(MODELS)
|
return list(MODELS)
|
||||||
|
|
||||||
|
def scored(self) -> list[str]:
|
||||||
|
return list(MODELS) # the curves, then the association on their scores
|
||||||
|
|
||||||
|
|
||||||
JOBS = Jobs()
|
JOBS = Jobs()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user