Options worth knowing#

  • Models. outcome_model= and gps=GPS(mean_model=..., scale_model=...) take any sklearn regressor. The default for each is default_model().

  • Weights. For a continuous dose the default is GPS(), density-based weights. BalancingWeights() (entropy balancing; population curve only) is an alternative. A dose with ≤ 30 distinct values (tiers, counts) uses DiscreteGPS automatically.

  • Uncertainty. band(simultaneous=False) for pointwise bands; draws() for any other summary. A group with no data (a new store) gets its parent’s curve with a wider, predictive band that adds the spread between groups (predictive=True, the default). The bands include the variance from estimating m(a) (nuisance_var=True, Kennedy et al. 2017); bootstrap_curves() refits the whole pipeline and is the only option that includes nuisance-model uncertainty (slow). coverage_check() runs a plasmode simulation on your own data to check how often the bands cover a known curve, and returns calibrated critical values.

  • Repeated units. fold_groups= keeps a customer’s rows in one cross-fitting fold; cluster= makes the robust covariance types cluster-robust.

  • Inputs. X may be a DataFrame (non-numeric columns are coded) and may contain missing values. Errors and warnings flag mismatched lengths, a constant or missing dose, groups with fewer than 10 rows, a point mass in the dose, and poor overlap after fitting.

  • Speed. About 45 s for 3,000 rows and 50 confounders on 2 cores; n_jobs=-1 runs the cross-fitting folds in parallel.