# `causalis.data_contracts.causal_diagnostic_data`

## Module Contents

### Classes

`DiagnosticData` | Base class for all diagnostic data_contracts.
`UnconfoundednessDiagnosticData` | Fields common to all models assuming unconfoundedness.
`MultiUnconfoundednessDiagnosticData` | Fields common to all models assuming unconfoundedness with multi_unconfoundedness.
`IVDiagnosticData` | Diagnostic payload for instrumental-variable estimators.
`DiffInMeansDiagnosticData` | Diagnostic data_contracts for Difference-in-Means model.
`CUPEDDiagnosticData` | Diagnostic data_contracts for CUPED-style (Lin-interacted OLS) adjustment.

### API

class causalis.data_contracts.causal_diagnostic_data.DiagnosticData(/, **data: Any)

  Bases: `pydantic.BaseModel`

  Base class for all diagnostic data_contracts.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  model_config

    ‘ConfigDict(…)’

class causalis.data_contracts.causal_diagnostic_data.UnconfoundednessDiagnosticData(/, **data: Any)

  Bases: `causalis.data_contracts.causal_diagnostic_data.DiagnosticData`

  Fields common to all models assuming unconfoundedness.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  m_hat: numpy.ndarray

    None

  m_hat_raw: Optional[numpy.ndarray]

    None

  d: numpy.ndarray

    None

  y: Optional[numpy.ndarray]

    None

  x: Optional[numpy.ndarray]

    None

  g0_hat: Optional[numpy.ndarray]

    None

  g1_hat: Optional[numpy.ndarray]

    None

  w: Optional[numpy.ndarray]

    None

  w_bar: Optional[numpy.ndarray]

    None

  psi_b: Optional[numpy.ndarray]

    None

  folds: Optional[numpy.ndarray]

    None

  trimming_threshold: float

    0.0

  normalize_ipw: Optional[bool]

    None

  sigma2: Optional[float]

    None

  nu2: Optional[float]

    None

  psi_sigma2: Optional[numpy.ndarray]

    None

  psi_nu2: Optional[numpy.ndarray]

    None

  riesz_rep: Optional[numpy.ndarray]

    None

  m_alpha: Optional[numpy.ndarray]

    None

  psi: Optional[numpy.ndarray]

    None

  score: Optional[str]

    None

  sensitivity_analysis: Optional[Dict[str, Any]]

    None

  score_plot_cache: Optional[Dict[str, Any]]

    None

  residual_plot_cache: Optional[Dict[str, Any]]

    None

  feature_importance: Optional[Dict[str, Any]]

    None

class causalis.data_contracts.causal_diagnostic_data.MultiUnconfoundednessDiagnosticData(/, **data: Any)

  Bases: `causalis.data_contracts.causal_diagnostic_data.DiagnosticData`

  Fields common to all models assuming unconfoundedness with multi_unconfoundedness.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  m_hat: numpy.ndarray

    None

  m_hat_raw: Optional[numpy.ndarray]

    None

  d: numpy.ndarray

    None

  y: Optional[numpy.ndarray]

    None

  x: Optional[numpy.ndarray]

    None

  g_hat: Optional[numpy.ndarray]

    None

  psi_b: Optional[numpy.ndarray]

    None

  folds: Optional[numpy.ndarray]

    None

  trimming_threshold: float

    0.0

  normalize_ipw: Optional[bool]

    None

  sigma2: Union[float, numpy.ndarray]

    None

  nu2: Optional[numpy.ndarray]

    None

  psi_sigma2: Optional[numpy.ndarray]

    None

  psi_nu2: Optional[numpy.ndarray]

    None

  riesz_rep: Optional[numpy.ndarray]

    None

  m_alpha: Optional[numpy.ndarray]

    None

  psi: Optional[numpy.ndarray]

    None

  score: Optional[str]

    None

  sensitivity_analysis: Optional[Dict[str, Any]]

    None

  residual_plot_cache: Optional[Dict[str, Any]]

    None

class causalis.data_contracts.causal_diagnostic_data.IVDiagnosticData(/, **data: Any)

  Bases: `causalis.data_contracts.causal_diagnostic_data.DiagnosticData`

  Diagnostic payload for instrumental-variable estimators.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  y: numpy.ndarray

    None

  d: numpy.ndarray

    None

  z: numpy.ndarray

    None

  x: Optional[numpy.ndarray]

    None

  x_names: List[str]

    ‘Field(…)’

  g0_hat: numpy.ndarray

    None

  g1_hat: numpy.ndarray

    None

  m_hat: numpy.ndarray

    None

  m_hat_raw: Optional[numpy.ndarray]

    None

  r0_hat: numpy.ndarray

    None

  r1_hat: numpy.ndarray

    None

  folds: Optional[numpy.ndarray]

    None

  psi: numpy.ndarray

    None

  psi_a: numpy.ndarray

    None

  psi_b: numpy.ndarray

    None

  phi_y: numpy.ndarray

    None

  phi_d: numpy.ndarray

    None

  score: str

    ‘LATE’

  trimming_threshold: float

    0.0

  normalize_ipw: Optional[bool]

    None

  instrument_overlap: Optional[Dict[str, Any]]

    None

  first_stage: Optional[Dict[str, Any]]

    None

  reduced_form: Optional[Dict[str, Any]]

    None

  diagnostics: Dict[str, Any]

    ‘Field(…)’

class causalis.data_contracts.causal_diagnostic_data.DiffInMeansDiagnosticData(/, **data: Any)

  Bases: `causalis.data_contracts.causal_diagnostic_data.DiagnosticData`

  Diagnostic data_contracts for Difference-in-Means model.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

class causalis.data_contracts.causal_diagnostic_data.CUPEDDiagnosticData(/, **data: Any)

  Bases: `causalis.data_contracts.causal_diagnostic_data.DiagnosticData`

  Diagnostic data_contracts for CUPED-style (Lin-interacted OLS) adjustment.

  Initialization

  Create a new model by parsing and validating input data from keyword arguments.

  Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

  `self` is explicitly positional-only to allow `self` as a field name.

  ate_naive: float

    None

  se_naive: float

    None

  variance_reduction_pct_same_cov: float

    None

  standard_error_reduction_pct_same_cov: float

    None

  r2_naive: float

    None

  r2_adj: float

    None

  beta_covariates: numpy.ndarray

    None

  gamma_interactions: numpy.ndarray

    None

  covariate_outcome_corr: Optional[numpy.ndarray]

    None

  covariates: List[str]

    None

  adj_type: str

    None

  regression_checks: Optional[causalis.scenarios.cuped.refutation.regression_checks.RegressionChecks]

    None