Return a one-row model-summary DataFrame for a fitted model.
summaries.glance(
model,
**kwargs,
)
Produces a single row of model-level statistics such as the number of observations, number of events, log-likelihood, AIC, and concordance. This is the Python equivalent of R’s broom::glance().
Parameters
model: object
-
A fitted Greenwood estimator (e.g., CoxPH, AFT, Parametric).
**kwargs: Any
-
Forwarded to the registered adapter. Common options include
format=.
Returns
DataFrame
-
A one-row model-level summary.
Examples
Glance at a fitted Cox model for its overall fit statistics:
import greenwood as gw
# Load data, build a right-censored response, and fit a Cox model
lung = gw.load_dataset("lung", backend="polars")
y = gw.Surv.right(lung["time"], event=(lung["status"] == 2))
cox = gw.CoxPH().fit(y, covariates=lung[["age", "sex"]])
# Glance at overall model-fit statistics
gw.glance(cox, format="polars")
shape: (1, 10)| n | nevent | loglik | aic | lr_statistic | df | lr_p_value | frailty_theta | frailty_lrt_statistic | frailty_lrt_p_value |
|---|
| i64 | i64 | f64 | f64 | f64 | i64 | f64 | null | null | null |
| 228 | 165 | -742.848246 | 1489.696492 | 14.123111 | 2 | 0.000857 | null | null | null |