Skip to content

critical_parameter_ranking

critical_parameter_ranking ¤

Outcome-driven ranking of candidate critical process parameters (CPPs).

During process development the question is rarely "is this signal in spec?" -- it is "which of these signals drives the outcome we care about?" This detector ranks candidate input parameters by their statistical association with a per-run quality outcome (yield, pass/fail, KPI), so the process development engineer can shortlist a small set of true CPPs for tighter control.

Three association measures are supported, all from scipy.stats:

  • pearson -- linear correlation (best when both inputs and outcome are continuous and approximately linear).
  • spearman -- rank correlation (robust to non-linear monotonic relationships and outliers).
  • anova_f -- one-way ANOVA F-statistic between groups defined by discrete levels of the parameter (the right test when factors were swept at discrete levels in a DOE).

CriticalParameterRankingEvents ¤

CriticalParameterRankingEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "dev:cpp_ranking",
    time_column: str = "systime"
)

Bases: Base

Rank input parameters by their statistical link to a quality outcome.

The detector operates on a per-run table where each row is a completed run (batch, DOE point, shift), each candidate column is the aggregated value of an input parameter during that run, and an outcome column holds the quality / yield measurement of interest.

The constructor still accepts a long-form dataframe for symmetry with the rest of ts-shape, but :meth:rank requires the wide-format per-run table directly because aggregating "the right number" for each parameter is a development-engineer judgment call (mean of the hold phase? settled value? peak?) that varies by parameter.

rank ¤

rank(
    per_run_df: DataFrame,
    candidate_columns: list[str],
    outcome_column: str,
    *,
    method: str = "spearman",
    anova_bins: int = 3
) -> pd.DataFrame

Rank candidate parameters by statistical association with the outcome.

Parameters:

Name Type Description Default
per_run_df DataFrame

One row per run, one column per candidate parameter, plus an outcome column.

required
candidate_columns list[str]

Columns to evaluate as candidate CPPs.

required
outcome_column str

Outcome (response) column.

required
method str

"pearson", "spearman", or "anova_f".

'spearman'
anova_bins int

Only used for method="anova_f". Each candidate column is quantile-binned into this many groups before the one-way ANOVA is run.

3

Returns:

Type Description
DataFrame

Summary DataFrame: parameter, method, statistic,

DataFrame

p_value, abs_effect_size, rank. Sorted by

DataFrame

abs_effect_size descending so the top driver is the first

DataFrame

row.

top_drivers ¤

top_drivers(
    per_run_df: DataFrame,
    candidate_columns: list[str],
    outcome_column: str,
    *,
    method: str = "spearman",
    k: int = 5,
    alpha: float = 0.05,
    anova_bins: int = 3
) -> pd.DataFrame

Return the top-k candidates with p_value <= alpha.

Wraps :meth:rank and filters by significance. The result keeps the same column schema as :meth:rank.