Discover environment invariant predictive model

Search every nonempty subset of up to eight candidate features for a sparse predictive relationship whose validation residual bias and error remain within governed limits across represented environments, select without touching the test split, and compare the chosen model once against the full model on future-held-out environment data.

What it's for

Moves Gitrevio beyond correlation dashboards by asking which relationships survive different teams, products, markets, policies, and time regimes—then protecting the final claim with a genuinely untouched test split.

What you give it

Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.

Field Type Role Required
complexity_penalty number ≥ 0, ≤ 100 Your calibration Optional
feature_names array of string ≥ 1 item Evidence Yes
max_detail_rows integer ≥ 1, ≤ 500 Numerical control Optional
maximum_environment_rmse_ratio number ≥ 1, ≤ 100 Your calibration Optional
maximum_normalized_environment_bias number ≥ 0, ≤ 10 Your calibration Optional
maximum_test_relative_loss number ≥ 0, ≤ 10 Your calibration Optional
observations array of objects (5 fields) ≥ 180 items Evidence Yes
ridge_penalty number ≥ 0, ≤ 1000000 Your calibration Optional

Each observations record

Field Type Required
environment_id string (non-empty) Yes
features object Yes
id string (non-empty) Yes
outcome number Yes
split one of "train", "validation", "test" Yes
Example input
{
  "feature_names": [
    "stable_feature",
    "environment_proxy"
  ],
  "maximum_environment_rmse_ratio": 2,
  "maximum_normalized_environment_bias": 0.25,
  "maximum_test_relative_loss": 0.1,
  "observations": [
    {
      "environment_id": "environment-0",
      "features": {
        "environment_proxy": 0,
        "stable_feature": 0
      },
      "id": "invariance-0-train-0",
      "outcome": 1,
      "split": "train"
    },
    {
      "environment_id": "environment-0",
      "features": {
        "environment_proxy": -0.12241743810962724,
        "stable_feature": 0.3271946967961522
      },
      "id": "invariance-0-train-1",
      "outcome": 1.5319719554826772,
      "split": "train"
    },
    {
      "environment_id": "environment-0",
      "features": {
        "environment_proxy": -0.45969769413186023,
        "stable_feature": 0.618369803069737
      },
      "id": "invariance-0-train-2",
      "outcome": 1.7770419120076137,
      "split": "train"
    },
    {
      "environment_id": "environment-0",
      "features": {
        "environment_proxy": -0.9292627983322971,
        "stable_feature": 0.8414709848078965

Truncated for display — the full payload is 1811 lines.

What you get back

This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.

Example output
{
  "assumptions": [
    "Environment labels represent real interventions, regimes, markets, periods, or operating conditions that could shift unstable relationships.",
    "Training fits models, validation selects invariance and sparsity, and the test split is untouched until one final comparison.",
    "The supplied practical bias and RMSE-ratio limits encode the deployment decision rather than being tuned to retain a preferred feature."
  ],
  "candidate_diagnostics": [
    {
      "accepted": true,
      "feature_names": [
        "stable_feature",
        "environment_proxy"
      ],
      "validation_environment_rmse_ratio": 1.4076,
      "validation_normalized_environment_bias": 0.236,
      "validation_worst_environment_rmse": 0.5576
    },
    {
      "accepted": true,
      "feature_names": [
        "stable_feature"
      ],
      "validation_environment_rmse_ratio": 1.1829,
      "validation_normalized_environment_bias": 0.0698,
      "validation_worst_environment_rmse": 0.7559
    },
    {
      "accepted": false,
      "feature_names": [
        "environment_proxy"
      ],
      "validation_environment_rmse_ratio": 1.2967,
      "validation_normalized_environment_bias": 0.2681,
      "validation_worst_environment_rmse": 1.6997
    }
  ],
  "decision": "environment_invariant_predictive_model_identified",
  "environment_support": [
    {
      "environment_id": "environment-0",
      "test": 20,
      "train": 20,
      "validation": 20
    },

Truncated for display — the full payload is 146 lines.

How it works

Decision analysis — Turn uncertainty, cost and risk appetite into a defensible choice, with the reasoning left inspectable.

  1. 1 Freeze meaningful environment labels plus separate train, validation, and test observations inside every environment; standardize features from training data only and reject constant or schema-inconsistent predictors.
  2. 2 Fit every nonempty feature subset with a training-only ridge model, then measure validation maximum normalized environment residual bias, cross-environment RMSE ratio, worst-environment error, and a locally governed sparsity penalty.
  3. 3 Accept only subsets clearing both practical invariance gates, select the lowest penalized worst-environment validation error, and evaluate that one selected model exactly once against the full-feature baseline on untouched test observations.
  4. 4 Return original-unit coefficients, leave-one-environment coefficient ranges, feature inclusion across accepted subsets, environment support, and explicit no-candidate or failed-test abstention states.

Before you trust it

Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.

Assumptions & guardrails

  • Actions, outcomes, utilities, evidence boundaries, uncertainty representation, and accountable ownership match the actual decision.
  • Environment labels encode interventions, regimes, time epochs, products, markets, or operating conditions capable of revealing unstable relationships—not arbitrary identifiers chosen after seeing results.
  • All environments contain sufficient independent train, validation, and test support under one outcome/feature definition, with no future or target leakage and no silent environment-specific preprocessing.
  • The candidate family contains a useful approximately linear invariant predictor and represented validation/test shifts are relevant to deployment; unseen shifts remain outside the guarantee.
  • The result structures a governed choice; it does not replace accountable judgment or authorize action outside the declared decision boundary.
  • Validation invariance and one held-out test support robustness only across represented environments and the enumerated linear feature family; they do not guarantee performance under a novel shift.
  • An invariant predictive feature is not automatically causal, manipulable, fair, or safe to optimize; causal-parent language requires stronger structural assumptions and interventions.
  • Do not translate selected features or environment diagnostics into named-person performance, employment, fraud, or security conclusions.

Minimum evidence

  • observations: at least 180 rows/items
  • feature_names: at least 1 rows/items

How to validate it

Validate on future periods or held-out aggregate units, compare with a simple baseline, and require stability across plausible metric definitions and decision thresholds.

Calibrating it to your org

Same for everyone

The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.

Specific to you

  • one fixed-grain feature/outcome matrix with separate train, validation, and test observations inside every environment
  • training-only feature scaling plus complete zero/missingness and chronological holdout policy
  • environment definition, feature family, outcome, aggregate grain, split epochs, ridge scale, invariance bias and RMSE-ratio gates, sparsity penalty, and acceptable final-test loss

Calibration workflow

  1. 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
  2. 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
  3. 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
  4. 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
  5. 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
  6. 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.

Call it from your AI

You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.

gitrevio_capabilities_search
  { "q": "search every nonempty subset of up" }
  → finds "discover_environment_invariant_predictive_model"

gitrevio_capability_describe
  { "capability_id": "discover_environment_invariant_predictive_model" }
  → returns the input schema and agent guidance shown on this page

gitrevio_capability_run
  { "capability_id": "discover_environment_invariant_predictive_model", "arguments": { ... } }
  → returns the result shown above

Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.

Related tools

Audit policy feedback performativity

Audit whether deploying a probability-driven policy is associated with a changed score-to-outcome relationship: compute cluster-level exposed-versus-comparison pre/post differences in predictions, outcomes, calibration residuals, and Brier loss; bootstrap the assignment unit; and abstain when baseline balance or score overlap cannot support the comparison.

Forecasting & survival

Forecast intervention effect half life

Learn how quickly a governed intervention's effect decays across resolved cohorts using a shared exponential half-life, cohort-specific amplitudes, a persistent floor, reported standard errors, and a profiled Bayesian grid; then forecast effect/value paths and when each current intervention is likely to fall below a practical threshold.

Sequential Bayesian & bandits

Analyze deep uncertainty minimax regret

Apply Savage minimax regret when scenario probabilities are not defensible, compare maximin and equal-weight choices, and use PRIM-style iterative peeling to discover compact context boxes where the robust choice remains vulnerable.

Decision analysis

Audit aggregate metric reversal

Detect Simpson's-paradox-style sign reversals between an executive aggregate relationship and its weighted within-stratum fixed-effect relationship, with whole-stratum bootstrap uncertainty and practical-magnitude gates.

Statistical audit & measurement

Audit informative metric missingness

Audit whether aggregate metric availability is associated with a governed outcome using permutation inference, bootstrap intervals, practical effect gates, and false-discovery control.

Statistical audit & measurement

Audit joint metric dependency drift

Detect changes in cross-metric dependence with empirical-copula ranks, random-feature permutation inference, sliced Wasserstein magnitude, and FDR-controlled pair diagnostics.

Statistical audit & measurement

See every tool in Measurement integrity →

Ready to See Your Engineering work clearly?

Request a free demo