Skip to content

Commit

Permalink
rolling out constraints feasibility and regression detection health c…
Browse files Browse the repository at this point in the history
…heck (#3180)

Summary:

Adding ConstraintsFeasibilityAnalysis and RegressionAnalysis healthchecks to prod.

Reviewed By: Cesar-Cardoso

Differential Revision: D66979530
  • Loading branch information
Jelena Markovic-Voronov authored and facebook-github-bot committed Dec 14, 2024
1 parent b259f1a commit 3705f40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions ax/analysis/healthcheck/constraints_feasibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ class ConstraintsFeasibilityAnalysis(HealthcheckAnalysis):
is below the threshold for at least one arm.
"""

def __init__(self, prob_threshold: float = 0.95) -> None:
r"""
Args:
prob_theshold: The threshold for the probability of constraint violation.
Returns None
"""
self.prob_threshold = prob_threshold

def compute(
self,
experiment: Experiment | None = None,
generation_strategy: GenerationStrategyInterface | None = None,
prob_threshold: float = 0.90,
) -> HealthcheckAnalysisCard:
r"""
Compute the feasibility of the constraints for the experiment.
Expand Down Expand Up @@ -118,20 +126,20 @@ def compute(
constraints_feasible, df = constraints_feasibility(
optimization_config=optimization_config,
model=model,
prob_threshold=prob_threshold,
prob_threshold=self.prob_threshold,
)
df["status"] = status

if not constraints_feasible:
status = HealthcheckStatus.WARNING
subtitle = (
"Constraints are infeasible for all test groups (arms) with respect "
f"to the probability threshold {prob_threshold}. "
f"to the probability threshold {self.prob_threshold}. "
"We suggest relaxing the constraint bounds for the constraints."
)
title_status = "Warning"
df.loc[
df["overall_probability_constraints_violated"] > prob_threshold,
df["overall_probability_constraints_violated"] > self.prob_threshold,
"status",
] = status

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_compute(self) -> None:
self.assertEqual(card.level, AnalysisCardLevel.LOW)
subtitle = (
"Constraints are infeasible for all test groups (arms) with respect "
"to the probability threshold 0.9. "
"to the probability threshold 0.95. "
"We suggest relaxing the constraint bounds for the constraints."
)
self.assertEqual(card.subtitle, subtitle)
Expand Down

0 comments on commit 3705f40

Please sign in to comment.