---
warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there
title: anofox_statistics
excerpt: |
DuckDB Community Extensions
A DuckDB extension for statistical regression and inference in SQL - OLS, Ridge, Elastic Net, LARS/LassoLars, WLS, recursive least squares, robust estimators (Huber, RANSAC, Theil-Sen), GLMs (Poisson, Negative Binomial, Binomial, Tweedie, Gamma, Logistic) with offset support, mixed-effects/hierarchical GLMs with random slopes and crossed/nested factors, AFT survival regression, explicit priors with Laplace intervals, empirical-Bayes shrinkage, and time-series regression, all with full diagnostics and inference.
extension:
name: anofox_statistics
description: A DuckDB extension for statistical regression and inference in SQL - OLS, Ridge, Elastic Net, LARS/LassoLars, WLS, recursive least squares, robust estimators (Huber, RANSAC, Theil-Sen), GLMs (Poisson, Negative Binomial, Binomial, Tweedie, Gamma, Logistic) with offset support, mixed-effects/hierarchical GLMs with random slopes and crossed/nested factors, AFT survival regression, explicit priors with Laplace intervals, empirical-Bayes shrinkage, and time-series regression, all with full diagnostics and inference.
language: C++
build: cmake
license: BSL 1.1
maintainers:
- sipemu
requires_toolchains: rust
repo:
github: DataZooDE/anofox-statistics
ref: afc9ebca4b7c91c97df3edaed751640645e0209a
variegata: afc9ebca4b7c91c97df3edaed751640645e0209a
extension_star_count: 20
extension_star_count_pretty: 20
extension_download_count: 2683
extension_download_count_pretty: 2.7k
image: '/images/community_extensions/social_preview/preview_community_extension_anofox_statistics.png'
layout: community_extension_doc
---
### Compatibility Matrix
This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
| :--- | :---: | :---: | :---: | :---: | :---: |
| Linux AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ |
| Linux ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ |
| macOS AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ |
| macOS ARM64 | ✅ | ❌ | ✅ | ✅ | ✅ |
| Windows AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ |
| Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ |
| WebAssembly | ✅ | ❌ | ✅ | ✅ | ✅ |
### Installing and Loading
```sql
INSTALL {{ page.extension.name }} FROM community;
LOAD {{ page.extension.name }};
```
{% if page.docs.hello_world %}
### Example
```sql
{{ page.docs.hello_world }}```
{% endif %}
{% if page.docs.extended_description %}
### About {{ page.extension.name }}
{{ page.docs.extended_description }}
{% endif %}
### Added Functions
| function_name | function_type | description | comment | examples |
|------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| acf_agg | aggregate | Sample autocorrelation function of x in the aggregate's ORDER BY order (R acf): one row per lag 0..max_lag with the 95% white-noise band conf_low/conf_high = -/+ qnorm(0.975)/sqrt(n). max_lag defaults to R's floor(10 log10 n). NULL values are skipped; NULL when n <= max_lag. | NULL | [acf_agg(resid, 10 ORDER BY t)] |
| acf_by | table_macro | Table macro: the sample autocorrelation function (R acf) of value_col ordered by order_col within each group of source, one row per lag (the integration contract's `curve` schema, curve_type 'acf'): the group column, model_id, series, curve_type, x (lag), y, y_low / y_high (95% white-noise band), threshold, weight, n_censor. max_lag defaults to R's floor(10 log10 n). | NULL | [acf_by('residuals', store, resid, t, max_lag := 12)] |
| ad_test_agg | aggregate | k-sample Anderson-Darling test (Scholz and Stephens; kSamples::ad.test, asymptotic p-value) of two or more groups. | NULL | [ad_test_agg(value, group_id, {'midrank': true})] |
| ad_test_agg | aggregate | k-sample Anderson-Darling test (Scholz and Stephens; kSamples::ad.test, asymptotic p-value) of two or more groups. Default options. | NULL | [ad_test_agg(value, group_id)] |
| aft_augment_agg | aggregate | Window aggregate: fits the same AFT model as aft_fit_agg over the frame and returns one STRUCT per input row (in frame order): linear_predictor, standardized_residual ((log t - eta) / scale), cox_snell_residual (-log S(t \| x)), score_contributions (intercept, coefficients, log(scale)) and is_training. Use it over a whole partition, as aft_augment_by does. | NULL | [aft_augment_agg(duration, [x1, x2], event) OVER ()] |
| aft_augment_agg | aggregate | Window aggregate: fits the same AFT model as aft_fit_agg over the frame and returns one STRUCT per input row (in frame order): linear_predictor, standardized_residual ((log t - eta) / scale), cox_snell_residual (-log S(t \| x)), score_contributions (intercept, coefficients, log(scale)) and is_training. Use it over a whole partition, as aft_augment_by does. With the options of aft_fit_agg. | NULL | [aft_augment_agg(duration, [x1, x2], event, {'distribution': 'lognormal'}) OVER ()] |
| aft_augment_by | table_macro | Table macro: fits an AFT survival model (aft_augment_agg, same options as aft_fit_agg) per group of source and returns every source row with its per-observation results (the integration contract's `obs` schema): all source columns, model_id and model_name ('aft'), row_id, fitted (the linear predictor of log T), residual (Cox-Snell, -log S(t \| x)), resid_type ('cox_snell'), std_residual ((log t - fitted) / scale), stud_residual, leverage, cooks_d, dffits (NULL), weight (1), is_training, n_params (NULL), then score_contributions (intercept, coefficients, log(scale)). Rows the fit could not use get NULLs. | NULL | [aft_augment_by('po_lines', supplier, days, [rating, qty], delivered)] |
| aft_cdf | scalar | Cumulative distribution P(T <= t) of an AFT survival time with linear predictor eta, scale and distribution (weibull, lognormal, loglogistic, exponential). | NULL | [aft_cdf(5.0, f.intercept + f.coefficients[1] * x1, f.scale, 'weibull')] |
| aft_fit_agg | aggregate | Fits an accelerated failure time (AFT) survival model to right-censored durations (event = 1 observed, 0 censored); coefficients are on the log-time scale. | NULL | [aft_fit_agg(duration, [x1, x2], event)] |
| aft_fit_agg | aggregate | Fits an accelerated failure time (AFT) survival model with a MAP of options (distribution, fit_intercept, compute_inference, confidence_level, ...). | NULL | [aft_fit_agg(duration, [x1, x2], event, {'distribution': 'lognormal'})] |
| aft_fit_agg | aggregate | Fits the same AFT model with a cluster-robust coefficient covariance (survreg(..., cluster = id), rms::robcov): std_errors, z tests, intercept_std_error and log_scale_std_error are clustered, plus vcov (intercept, coefficients, log(scale)), vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default false, as survreg); with priors the penalized bread is used. compute_inference defaults to true. | NULL | [aft_fit_agg(duration, [x1, x2], event, patient_id, MAP {})] |
| aft_glance_by | table_macro | Table macro: fits an accelerated failure time (AFT) survival model per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [aft_glance_by('my_table', group_col, y, [x1, x2], event)] |
| aft_quantile | scalar | p-quantile of an AFT survival time with linear predictor eta, scale and distribution (weibull, lognormal, loglogistic, exponential). | NULL | [aft_quantile(0.5, f.intercept + f.coefficients[1] * x1, f.scale, 'weibull')] |
| aft_survival | scalar | Model-based survival curve S(t \| x) of a fitted AFT model (the STRUCT returned by aft_fit_agg) for the covariate row x, at each of times (R psurvreg(t, eta, scale, dist, lower.tail = FALSE)): one {time, surv} per time. | NULL | [aft_survival(m, [1.0, 0.5], [1, 5, 10, 20])] |
| aft_tidy_by | table_macro | Table macro: fits an accelerated failure time (AFT) survival model per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [aft_tidy_by('my_table', group_col, y, [x1, x2], event, names := ['x1', 'x2'])] |
| aic | scalar | Computes Akaike Information Criterion (AIC) from residual sum of squares, number of observations, and number of parameters. | NULL | [aic(rss, n, k)] |
| aid_agg | aggregate | Classifies demand patterns (smooth, intermittent, erratic, lumpy) using Automatic Identification of Demand (AID). | NULL | [aid_agg(y)] |
| aid_agg | aggregate | Classifies demand patterns using AID with a MAP of options (intermittent_threshold, outlier_method). | NULL | [aid_agg(y, {'intermittent_threshold': 0.3})] |
| aid_anomaly_agg | aggregate | Identifies anomalies in demand time series using AID with a MAP of options (intermittent_threshold, outlier_method). | NULL | [aid_anomaly_agg(y, {'outlier_method': 'iqr'})] |
| aid_anomaly_agg | aggregate | Identifies anomalies in demand time series using the AID classification framework. | NULL | [aid_anomaly_agg(y)] |
| aid_anomaly_by | table_macro | Table macro: AID anomaly flags per group of source, ordered by order_col; returns one row per input row with stockout, new_product, obsolete_product, high_outlier and low_outlier flags. | NULL | [aid_anomaly_by('sales', product_id, date, demand)] |
| aid_by | table_macro | Table macro: Automatic Identification of Demand (AID); classifies the demand pattern of each group of source and returns one row per group. Pass order_by := (by name): AID reads each series in order. | NULL | [aid_by('sales', product_id, demand, order_by := week)] |
| alm_fit_agg | aggregate | Fits an Additive Linear Model (ALM) and returns coefficients and fit statistics. | NULL | [alm_fit_agg(y, x)] |
| alm_fit_agg | aggregate | Fits an Additive Linear Model (ALM) and returns coefficients and fit statistics. | NULL | [alm_fit_agg(y, x, {'fit_intercept': true})] |
| alm_fit_predict_agg | aggregate | Fits an Additive Linear Model on training rows with a MAP of options and predicts all rows. | NULL | [alm_fit_predict_agg(y, x, split_col, {'distribution': 'laplace'})] |
| alm_fit_predict_agg | aggregate | Fits an Additive Linear Model over a partition and returns per-row predictions. | NULL | [alm_fit_predict_agg(y, x)] |
| alm_fit_predict_agg | aggregate | Fits an Additive Linear Model over a partition with a MAP of options and returns per-row predictions. | NULL | [alm_fit_predict_agg(y, x, {'distribution': 'laplace'})] |
| alm_fit_predict_agg | aggregate | Fits an Additive Linear Model using only training rows (split_col='train') and predicts all rows. | NULL | [alm_fit_predict_agg(y, x, split_col)] |
| alm_fit_predict_by | table_macro | Table macro: fits an Augmented Linear Model (ALM) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [alm_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| alm_glance_by | table_macro | Table macro: fits an augmented linear model (ALM) per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [alm_glance_by('my_table', group_col, y, [x1, x2])] |
| alm_prediction_by | table_macro | Table macro: fits an augmented linear model (ALM) per group of source (alm_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('alm'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [alm_prediction_by('sales', store, week, revenue, [price, promo])] |
| alm_tidy_by | table_macro | Table macro: fits an augmented linear model (ALM) per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [alm_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| anofox_contract_version | scalar | Returns the version of the anofox integration contract (output schemas and duckdb_functions() tags) this extension implements. | NULL | [anofox_contract_version()] |
| ard_fit_agg | aggregate | Fits an ARD regression per group (scikit-learn ARDRegression: one Gaussian prior precision per coefficient, features whose precision reaches threshold_lambda are pruned to 0) and returns the posterior mean coefficients, intercept, R^2, noise_precision (alpha_), weight_precisions (lambda_, one per feature), the posterior standard deviation of each coefficient and the iteration count. | NULL | [ard_fit_agg(y, [x1, x2, x3])] |
| ard_fit_agg | aggregate | Fits an ARD regression per group (scikit-learn ARDRegression: one Gaussian prior precision per coefficient, features whose precision reaches threshold_lambda are pruned to 0) and returns the posterior mean coefficients, intercept, R^2, noise_precision (alpha_), weight_precisions (lambda_, one per feature), the posterior standard deviation of each coefficient and the iteration count. | NULL | [ard_fit_agg(y, [x1, x2, x3], {'threshold_lambda': 1000})] |
| ard_fit_predict_agg | aggregate | Fits an ARD (automatic relevance determination) regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [ard_fit_predict_agg(y, x)] |
| ard_fit_predict_agg | aggregate | Fits an ARD (automatic relevance determination) regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [ard_fit_predict_agg(y, x, split)] |
| ard_fit_predict_agg | aggregate | Fits an ARD (automatic relevance determination) regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [ard_fit_predict_agg(y, x, split, {'fit_intercept': false})] |
| ard_fit_predict_agg | aggregate | Fits an ARD (automatic relevance determination) regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [ard_fit_predict_agg(y, x, {'confidence_level': 0.9})] |
| ard_fit_predict_by | table_macro | Table macro: fits an ARD (automatic relevance determination) regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training appended. | NULL | [ard_fit_predict_by('my_table', group_col, y, [x1, x2, x3])] |
| ard_glance_by | table_macro | Table macro: fits an ARD (automatic relevance determination) regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [ard_glance_by('my_table', group_col, y, [x1, x2])] |
| ard_prediction_by | table_macro | Table macro: fits an ARD (automatic relevance determination) regression per group of source (ard_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('ard'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [ard_prediction_by('sales', store, week, revenue, [price, promo])] |
| ard_tidy_by | table_macro | Table macro: fits an ARD (automatic relevance determination) regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. std_error is the posterior standard deviation and conf_low / conf_high the central Bayesian credible interval at conf_level (options' confidence_level), not a frequentist confidence interval; statistic and p_value are NULL. names := [...] labels the terms. | NULL | [ard_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| areg_fit_agg | aggregate | Additive regression with optimal transformations of both sides (Hmisc::areg): y and each predictor are expanded into restricted cubic splines (4 knots), and the first canonical correlation gives the transformation of y and the additive transformations of the predictors that maximise R^2. Returns x_coefficients / y_coefficients (intercept first), r_squared, mad / med (mean / median \|y - yhat\|, NULL when the y transformation is not monotone), x_df, y_df, the bases (x_types, x_parameters: knots or levels, y_type, y_parameters, y_min, y_max) and n_observations. Rows with a NULL or non-finite value are skipped. | NULL | [areg_fit_agg(y, [x1, x2])] |
| areg_fit_agg | aggregate | areg with options: nk (knots, default 4; 0 makes every spline linear), x_types (one of 's' spline, 'l' linear, 'c' categorical, or one per predictor), y_type ('s', 'l', 'c'). | NULL | [areg_fit_agg(y, [x1, x2, g], {'x_types': ['s', 'l', 'c']})] |
| areg_impute_agg | aggregate | Multiple imputation by additive regression, bootstrapping and predictive mean matching (Hmisc::aregImpute on the variables of x, rows in id order; NULL or NaN elements are missing). Returns the completed data sets as LIST(STRUCT(imputation INTEGER, id, x DOUBLE[])), imputation 1..n_impute; observed values are kept. With the same seed the imputations replay set.seed(seed); aregImpute(...) in R. | NULL | [areg_impute_agg(id, [y, x1, x2])] |
| areg_impute_agg | aggregate | areg_impute_agg with options: n_impute (5), nk (3), tlinear (true), burnin (Hmisc default), match ('weighted' \| 'closest'), fweighted (0.2), seed (1), categorical and linear (1-based positions in x). | NULL | [areg_impute_agg(id, [y, x1, g], {'n_impute': 10, 'categorical': [3], 'seed': 42})] |
| areg_impute_by | table_macro | Table macro: multiple imputation per group of source (areg_impute_agg over the group's rows of x_cols in id_col order, options as areg_impute_agg); returns one row per group, imputation and id with the completed x (DOUBLE[]). | NULL | [areg_impute_by('survey', region, respondent_id, [age, income, score], options := {'n_impute': 5})] |
| areg_inverse | scalar | Back-transforms a value t of the transformed response to the y scale (the fit's yinv: linear interpolation over the range of y, constant beyond it). NULL when the transformation is not monotone or the response categorical. | NULL | [areg_inverse(model, 0.2)] |
| areg_predict | scalar | The linear predictor (transformed-y scale) of a predictor row x under an areg_fit_agg model (Hmisc predict.areg(type = 'lp')), rebuilt from the stored bases and coefficients. NULL when the model or x is NULL or x holds a NULL. | NULL | [areg_predict(model, [1.2, 0.5])] |
| areg_predict | scalar | areg_predict with options: type 'lp' (default) or 'fitted' (back-transformed to the y scale, predict.areg(type = 'fitted'); NULL when the y transformation is not monotone). | NULL | [areg_predict(model, [1.2, 0.5], {'type': 'fitted'})] |
| areg_transform | scalar | The optimal transformation of the response at y under an areg_fit_agg model (the fit's ytrans). | NULL | [areg_transform(model, 3.5)] |
| auc_agg | aggregate | Area under the ROC curve (scikit-learn roc_auc_score, pROC auc); ties count one half. NULL when only one class is present. | NULL | [auc_agg(y_true, score)] |
| auc_null_p_value | scalar | One-sided p-value P(AUC_random >= auc) of an observed ROC AUC against random scores, exact from the Mann-Whitney distribution. | NULL | [auc_null_p_value(0.8, 10, 10)] |
| auc_null_quantile | scalar | Quantile of the ROC AUC of a random classifier with n_pos positive and n_neg negative cases: the smallest AUC a with P(AUC <= a) >= p, exact from the Mann-Whitney distribution (R qwilcox(p, n_pos, n_neg) / (n_pos * n_neg)). | NULL | [auc_null_quantile(0.95, 10, 10)] |
| bayesian_ridge_fit_agg | aggregate | Fits a Bayesian Ridge regression per group (scikit-learn BayesianRidge: Gaussian prior on the coefficients, noise and weight precisions estimated by evidence maximisation) and returns the posterior mean coefficients, intercept, R^2, noise_precision (alpha_), weight_precision (lambda_), the posterior standard deviation of each coefficient, the iteration count and the log marginal likelihood. | NULL | [bayesian_ridge_fit_agg(y, [x1, x2, x3])] |
| bayesian_ridge_fit_agg | aggregate | Fits a Bayesian Ridge regression per group (scikit-learn BayesianRidge: Gaussian prior on the coefficients, noise and weight precisions estimated by evidence maximisation) and returns the posterior mean coefficients, intercept, R^2, noise_precision (alpha_), weight_precision (lambda_), the posterior standard deviation of each coefficient, the iteration count and the log marginal likelihood. | NULL | [bayesian_ridge_fit_agg(y, [x1, x2, x3], {'max_iterations': 500})] |
| bayesian_ridge_fit_predict_agg | aggregate | Fits a Bayesian Ridge regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [bayesian_ridge_fit_predict_agg(y, x)] |
| bayesian_ridge_fit_predict_agg | aggregate | Fits a Bayesian Ridge regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [bayesian_ridge_fit_predict_agg(y, x, split)] |
| bayesian_ridge_fit_predict_agg | aggregate | Fits a Bayesian Ridge regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [bayesian_ridge_fit_predict_agg(y, x, split, {'fit_intercept': false})] |
| bayesian_ridge_fit_predict_agg | aggregate | Fits a Bayesian Ridge regression over a partition (training rows: y NOT NULL and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training. | NULL | [bayesian_ridge_fit_predict_agg(y, x, {'confidence_level': 0.9})] |
| bayesian_ridge_fit_predict_by | table_macro | Table macro: fits a Bayesian Ridge regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat, yhat_lower / yhat_upper (posterior predictive interval at confidence_level, default 0.95) and is_training appended. | NULL | [bayesian_ridge_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| bayesian_ridge_glance_by | table_macro | Table macro: fits a Bayesian Ridge regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [bayesian_ridge_glance_by('my_table', group_col, y, [x1, x2])] |
| bayesian_ridge_prediction_by | table_macro | Table macro: fits a Bayesian Ridge regression per group of source (bayesian_ridge_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('bayesian_ridge'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [bayesian_ridge_prediction_by('sales', store, week, revenue, [price, promo])] |
| bayesian_ridge_tidy_by | table_macro | Table macro: fits a Bayesian Ridge regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. std_error is the posterior standard deviation and conf_low / conf_high the central Bayesian credible interval at conf_level (options' confidence_level), not a frequentist confidence interval; statistic and p_value are NULL. names := [...] labels the terms. | NULL | [bayesian_ridge_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| bic | scalar | Computes Bayesian Information Criterion (BIC) from residual sum of squares, number of observations, and number of parameters. | NULL | [bic(rss, n, k)] |
| binom_test_agg | aggregate | Performs an exact binomial test comparing an observed success count to a hypothesized probability, using default options. | NULL | [binom_test_agg(value)] |
| binom_test_agg | aggregate | Performs an exact binomial test comparing an observed success count to a hypothesized probability. | NULL | [binom_test_agg(value, {'p0': 0.5, 'alternative': 'two_sided'})] |
| binomial_augment_agg | aggregate | Fits a Binomial GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [binomial_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| binomial_augment_agg | aggregate | Fits a Binomial GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [binomial_augment_agg(y, [x1, x2], {'binomial_link': 'logit'}) OVER ()] |
| binomial_augment_by | table_macro | Table macro: fits a Binomial GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [binomial_augment_by('my_table', group_col, y, [x1, x2])] |
| binomial_effects_by | table_macro | Table macro: marginal-effect grid of a binomial GLM per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of binomial_tidy_by). | NULL | [binomial_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| binomial_fit_agg | aggregate | Fits a Binomial GLM (logit link by default) and returns coefficients, deviance, AIC, dispersion, and fit statistics. y is the success rate in [0, 1]. | NULL | [binomial_fit_agg(y, x)] |
| binomial_fit_agg | aggregate | Fits a Binomial GLM (user-selectable link: logit / probit / cloglog; default logit) and returns coefficients, deviance, AIC, dispersion (= 1 for canonical binomial), and fit statistics. y is the success rate in [0, 1]. | NULL | [binomial_fit_agg(y, x, {'binomial_link': 'logit', 'fit_intercept': true})] |
| binomial_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [binomial_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| binomial_fit_predict_by | table_macro | Table macro: fits a binomial GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [binomial_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| binomial_glance_by | table_macro | Table macro: fits a binomial GLM per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [binomial_glance_by('my_table', group_col, y, [x1, x2])] |
| binomial_partial_residuals_agg | aggregate | Fits a Binomial GLM over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [binomial_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| binomial_partial_residuals_by | table_macro | Table macro: fits a binomial GLM per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [binomial_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| binomial_prediction_by | table_macro | Table macro: fits a binomial GLM per group of source (binomial_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('binomial'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [binomial_prediction_by('sales', store, week, revenue, [price, promo])] |
| binomial_tidy_by | table_macro | Table macro: fits a binomial GLM per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [binomial_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| bls_fit_agg | aggregate | Fits a Bounded Least Squares (BLS) regression with coefficient bounds and returns fit statistics. | NULL | [bls_fit_agg(y, x)] |
| bls_fit_agg | aggregate | Fits a Bounded Least Squares (BLS) regression with coefficient bounds and returns fit statistics. | NULL | [bls_fit_agg(y, x, {'lower_bound': 0.0, 'upper_bound': 1.0})] |
| bls_fit_predict_agg | aggregate | Fits a Bounded Least Squares model on training rows with a MAP of options and predicts all rows. | NULL | [bls_fit_predict_agg(y, x, split_col, {'null_policy': 'drop'})] |
| bls_fit_predict_agg | aggregate | Fits a Bounded Least Squares model over a partition and returns per-row predictions. | NULL | [bls_fit_predict_agg(y, x)] |
| bls_fit_predict_agg | aggregate | Fits a Bounded Least Squares model over a partition with a MAP of options and returns per-row predictions. | NULL | [bls_fit_predict_agg(y, x, {'null_policy': 'drop'})] |
| bls_fit_predict_agg | aggregate | Fits a Bounded Least Squares model using only training rows (split_col='train') and predicts all rows. | NULL | [bls_fit_predict_agg(y, x, split_col)] |
| bls_fit_predict_by | table_macro | Table macro: fits a bounded/non-negative least squares (BLS) regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [bls_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| bls_glance_by | table_macro | Table macro: fits a bounded least squares regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [bls_glance_by('my_table', group_col, y, [x1, x2])] |
| bls_prediction_by | table_macro | Table macro: fits a bounded least squares regression per group of source (bls_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('bls'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [bls_prediction_by('sales', store, week, revenue, [price, promo])] |
| bls_tidy_by | table_macro | Table macro: fits a bounded least squares regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model has no coefficient inference. names := [...] labels the terms. | NULL | [bls_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| bootcov_agg | aggregate | Bootstrap covariance of a regression model's coefficients (rms::bootcov): one row per coefficient ((Intercept), x1, ...) with estimate (the fit on all rows), std_error (bootstrap), conf_low / conf_high (percentile interval), conf_level, boot_mean, vcov (the coefficient's row of the bootstrap covariance), n_boot and n_failed. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. | NULL | [bootcov_agg(y, [x1, x2])] |
| bootcov_agg | aggregate | Bootstrap covariance of a regression model's coefficients (rms::bootcov): one row per coefficient ((Intercept), x1, ...) with estimate (the fit on all rows), std_error (bootstrap), conf_low / conf_high (percentile interval), conf_level, boot_mean, vcov (the coefficient's row of the bootstrap covariance), n_boot and n_failed. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. Options: model, B (default 200), seed (default 42), conf_level (0.95), feature_names. | NULL | [bootcov_agg(y, [x1, x2], {'B': 500, 'seed': 1})] |
| bootcov_agg | aggregate | Bootstrap covariance of a regression model's coefficients (rms::bootcov): one row per coefficient ((Intercept), x1, ...) with estimate (the fit on all rows), std_error (bootstrap), conf_low / conf_high (percentile interval), conf_level, boot_mean, vcov (the coefficient's row of the bootstrap covariance), n_boot and n_failed. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. With a cluster id (any type) per row: the cluster bootstrap resamples whole clusters (bootcov(cluster = id)). | NULL | [bootcov_agg(y, [x1, x2], patient_id, {'model': 'logistic'})] |
| bootcov_by | table_macro | Table macro: bootstrap covariance of the coefficients (bootcov_agg, same options) per group of source, one row per term in the integration contract's `terms` schema: the group column, id (the group), model_id ('bootcov'), model_name (the model), term, estimate, std_error (bootstrap), statistic, p_value (NULL), conf_low, conf_high (percentile interval), conf_level, index_name, index_value, then boot_mean, vcov, n_boot, n_failed. cluster := column resamples whole clusters; names := [...] labels the terms. | NULL | [bootcov_by('patients', site, died, [age, sbp], options := {'model': 'logistic'}, cluster := patient_id)] |
| bootstrap_mean_ci_agg | aggregate | Percentile bootstrap confidence interval of the mean of x (IID bootstrap, 10000 replicates, 95%, seeded). | NULL | [bootstrap_mean_ci_agg(x)] |
| bootstrap_mean_ci_agg | aggregate | Percentile bootstrap confidence interval of the mean of x. options: method 'iid' \| 'stationary' (geometric blocks of mean block_length, R tsboot(sim = 'geom')) \| 'circular_block' (blocks of block_length consecutive values, wrapping around, R tsboot(sim = 'fixed')) \| 'moving_block' (non-wrapping blocks), resampling the series in the aggregate's ORDER BY order; n_bootstrap, block_length, confidence_level, seed. | NULL | [bootstrap_mean_ci_agg(x, {'method': 'stationary', 'block_length': 5} ORDER BY t), bootstrap_mean_ci_agg(x, {'method': 'circular_block', 'block_length': 5} ORDER BY t)] |
| box_cox_agg | aggregate | Box-Cox profile likelihood of lambda for the linear model of a positive y on x (MASS::boxcox(lm(y ~ x))). Returns lambda, ci_lower, ci_upper (NULL when not reached within the grid), confidence_level, max_log_likelihood, lambdas, log_likelihood and n_observations. Rows with a NULL or non-finite value are skipped. | NULL | [box_cox_agg(y, [x1, x2])] |
| box_cox_agg | aggregate | Box-Cox profile likelihood of the power lambda for the intercept-only linear model of a positive y (MASS::boxcox(y ~ 1)): the maximising lambda with its likelihood-ratio interval and the profile on the grid seq(-2, 2, 0.1). | NULL | [box_cox_agg(y)] |
| box_cox_agg | aggregate | Box-Cox profile with options: lambdas (grid, default seq(-2, 2, 0.1)), confidence_level (0.95), fit_intercept (true), eps (1/50). | NULL | [box_cox_agg(y, [x1], {'confidence_level': 0.9})] |
| box_cox_inverse | scalar | Inverse Box-Cox transform: (lambda z + 1)^(1 / lambda), exp(z) at lambda = 0; NULL where lambda z + 1 <= 0 has no real inverse. | NULL | [box_cox_inverse(z, 0.5)] |
| box_cox_transform | scalar | Box-Cox transform of a positive y: (y^lambda - 1) / lambda, log(y) at lambda = 0. | NULL | [box_cox_transform(y, 0.5)] |
| box_pierce_agg | aggregate | Box-Pierce portmanteau test for autocorrelation of x in the aggregate's ORDER BY order (R Box.test(x, lag, type = 'Box-Pierce', fitdf)). lag defaults to 1, fitdf to 0. | NULL | [box_pierce_agg(resid, 10 ORDER BY t)] |
| breusch_pagan_agg | aggregate | Breusch-Pagan test for heteroskedasticity of regression residuals against the regressors x (R lmtest::bptest): statistic, df1, p_value. studentize (default true) is Koenker's robust variant, bptest's default; false gives the original 1979 statistic. | NULL | [breusch_pagan_agg(resid, [x1, x2])] |
| breusch_pagan_agg | aggregate | Breusch-Pagan test for heteroskedasticity of regression residuals against the regressors x (R lmtest::bptest): statistic, df1, p_value. studentize (default true) is Koenker's robust variant, bptest's default; false gives the original 1979 statistic. | NULL | [breusch_pagan_agg(resid, [x1, x2], false)] |
| brier_agg | aggregate | Brier score: mean squared difference between the predicted probability and the 0/1 outcome (scikit-learn brier_score_loss). | NULL | [brier_agg(y_true, prob)] |
| brown_forsythe_agg | aggregate | Tests equality of variances across groups using the Brown-Forsythe test. | NULL | [brown_forsythe_agg(value, group_id)] |
| brunner_munzel_agg | aggregate | Performs the Brunner-Munzel test for stochastic equality of two independent samples, using default options. | NULL | [brunner_munzel_agg(value, group_id)] |
| brunner_munzel_agg | aggregate | Performs the Brunner-Munzel test for stochastic equality of two independent samples. | NULL | [brunner_munzel_agg(value, group_id, {'alternative': 'two_sided'})] |
| bspline | scalar | B-spline basis of x on the given (strictly increasing) base knots, as sklearn SplineTransformer: n_knots + degree - 1 columns (degree 3 by default). options: extrapolation 'constant' \| 'linear' \| 'continue' \| 'periodic' \| 'error', include_bias (default true). | NULL | [bspline(x, [0.0, 2.5, 5.0, 7.5, 10.0])] |
| bspline | scalar | B-spline basis of x on the given (strictly increasing) base knots, as sklearn SplineTransformer: n_knots + degree - 1 columns (degree 3 by default). options: extrapolation 'constant' \| 'linear' \| 'continue' \| 'periodic' \| 'error', include_bias (default true). | NULL | [bspline(x, [0.0, 5.0, 10.0], 2)] |
| bspline | scalar | B-spline basis of x on the given (strictly increasing) base knots, as sklearn SplineTransformer: n_knots + degree - 1 columns (degree 3 by default). options: extrapolation 'constant' \| 'linear' \| 'continue' \| 'periodic' \| 'error', include_bias (default true). | NULL | [bspline(x, [0.0, 5.0, 10.0], 3, {'extrapolation': 'linear', 'include_bias': false})] |
| bspline_knots_agg | aggregate | Base knots of a B-spline placed on x (n_knots, default 5), as sklearn SplineTransformer: options knots 'uniform' (default) \| 'quantile'. | NULL | [bspline_knots_agg(x)] |
| bspline_knots_agg | aggregate | Base knots of a B-spline placed on x (n_knots, default 5), as sklearn SplineTransformer: options knots 'uniform' (default) \| 'quantile'. | NULL | [bspline_knots_agg(x, 6)] |
| bspline_knots_agg | aggregate | Base knots of a B-spline placed on x (n_knots, default 5), as sklearn SplineTransformer: options knots 'uniform' (default) \| 'quantile'. | NULL | [bspline_knots_agg(x, 6, {'knots': 'quantile'})] |
| calibrate_agg | aggregate | Overfitting-corrected calibration curve of a regression model (rms::calibrate): one row per grid point predy with calibrated_orig (apparent lowess calibration), calibrated_corrected, optimism, n, and the mean absolute / mean squared / 0.9 quantile absolute error of the corrected curve. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. | NULL | [calibrate_agg(y, [x1, x2])] |
| calibrate_agg | aggregate | Overfitting-corrected calibration curve of a regression model (rms::calibrate): one row per grid point predy with calibrated_orig (apparent lowess calibration), calibrated_corrected, optimism, n, and the mean absolute / mean squared / 0.9 quantile absolute error of the corrected curve. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. Options: model, method ('boot' \| 'crossvalidation' \| '.632'), B (default 40), seed (default 42), predy (the grid; default 50 points between the 5th smallest and 5th largest prediction). | NULL | [calibrate_agg(y, [x1, x2], {'model': 'logistic', 'B': 200})] |
| calibrate_by | table_macro | Table macro: the overfitting-corrected calibration curve (calibrate_agg, same options) per group of source, one row per grid point in the integration contract's `curve` schema: the group column, id (the group), model_id ('calibrate'), model_name (the model), curve_type ('calibrate'), series, x (predy), y (calibrated_corrected), y_low, y_high, threshold, weight, n_censor, then predy, calibrated_orig, calibrated_corrected, optimism, n, mean_abs_error, mean_squared_error, quantile90_abs_error, method. | NULL | [calibrate_by('patients', site, died, [age, sbp], options := {'model': 'logistic'})] |
| calibrate_cph_agg | aggregate | Survival calibration of a Cox model at time u (rms::calibrate.cph, cmethod 'KM'): subjects are grouped by quantiles of predicted survival at u (about m per group, or the given cuts); one row per group with group_index, cut_low, cut_high, mean_predicted, km (Kaplan-Meier at u), km_corrected, std_err, and the resampling table (index_orig = km - mean_predicted, training, test, optimism, index_corrected, n). event is 1 for an event and 0 for censoring. Options: u (required), m (default 50), cuts, method ('boot' \| 'crossvalidation' \| '.632'), B (default 40), seed (default 42), ties ('efron' \| 'breslow'), max_iterations (20), tolerance (1e-9; rms::cph uses 1e-4 and 10). | NULL | [calibrate_cph_agg(time, [x1, x2], event, {'u': 5, 'm': 60, 'B': 100})] |
| calibrate_cph_by | table_macro | Table macro: survival calibration of a Cox model at time u (calibrate_cph_agg, same options; u is required) per group of source, one row per group of predicted survival: the group column, group_index, cut_low, cut_high, mean_predicted, km, km_corrected, std_err, index_orig, training, test, optimism, index_corrected, n, u, method. | NULL | [calibrate_cph_by('patients', site, days, [age, treated], died, options := {'u': 365})] |
| calibration_agg | aggregate | Calibration (reliability) curve over n_bins equal-width bins of [0, 1] as a LIST of {bin, mean_pred, frac_pos, n, conf_low, conf_high} (scikit-learn calibration_curve, strategy 'uniform'); empty bins are omitted, bin is zero-based, and conf_low/conf_high are Wilson intervals (default conf_level 0.95). | NULL | [calibration_agg(y_true, prob, 10)] |
| calibration_curve_by | table_macro | Table macro: computes the calibration curve (x = mean predicted probability, y = fraction of positives, y_low/y_high = Wilson interval, weight = bin count; see calibration_agg) per group of source and returns one row per point in curve order (the integration contract's `curve` schema): the group column, model_id, series, curve_type ('calibration'), x, y, y_low, y_high, threshold, weight, n_censor. y_true_col is BOOLEAN or 0/1. | NULL | [calibration_curve_by('scored', model, label, prob, n_bins := 10)] |
| category_proportions_agg | aggregate | Shares of each category in the reference and the current group, over the sorted categories seen in either group (upstream category_proportions): the inputs of psi_agg, kl_divergence_agg, jensen_shannon_agg, hellinger_agg and tvd_agg on categories. | NULL | [category_proportions_agg(value, group_id, {'reference': 0})] |
| category_proportions_agg | aggregate | Shares of each category in the reference and the current group, over the sorted categories seen in either group (upstream category_proportions): the inputs of psi_agg, kl_divergence_agg, jensen_shannon_agg, hellinger_agg and tvd_agg on categories. Default options. | NULL | [category_proportions_agg(value, group_id)] |
| chisq_drift_agg | aggregate | Chi-squared goodness-of-fit test of the current category counts against the reference shares (evidently 'chisquare'; R chisq.test(o, p = r / sum(r))). | NULL | [chisq_drift_agg(value, group_id, {'reference': 0})] |
| chisq_drift_agg | aggregate | Chi-squared goodness-of-fit test of the current category counts against the reference shares (evidently 'chisquare'; R chisq.test(o, p = r / sum(r))). Default options. | NULL | [chisq_drift_agg(value, group_id)] |
| chisq_gof_agg | aggregate | Performs a chi-squared goodness-of-fit test comparing observed frequencies to expected probabilities. | NULL | [chisq_gof_agg(observed, expected_prob)] |
| chisq_test_agg | aggregate | Performs a chi-squared test of independence on a 2×2 contingency table from two categorical columns. | NULL | [chisq_test_agg(row_var, col_var)] |
| chisq_test_agg | aggregate | Performs a chi-squared test of independence on a 2×2 contingency table from two categorical columns. | NULL | [chisq_test_agg(row_var, col_var, {'correction': true})] |
| clark_west_agg | aggregate | Performs the Clark-West test to compare a nested forecast model against an encompassing model, using default options. | NULL | [clark_west_agg(actual, forecast_restricted, forecast_unrestricted)] |
| clark_west_agg | aggregate | Performs the Clark-West test to compare a nested forecast model against an encompassing model. | NULL | [clark_west_agg(actual, forecast_restricted, forecast_unrestricted, {'horizon': 1})] |
| cohen_kappa_agg | aggregate | Computes Cohen's kappa, a measure of inter-rater agreement for categorical classifications. | NULL | [cohen_kappa_agg(rater1, rater2)] |
| cohen_kappa_agg | aggregate | Computes Cohen's kappa, a measure of inter-rater agreement for categorical classifications. | NULL | [cohen_kappa_agg(rater1, rater2, {'weighted': false})] |
| column_drift_agg | aggregate | evidently's drift of one column: runs the named test (or evidently's default choice for 'auto', by reference size, number of distinct values and column type) and compares the score (a p-value or a distance) with the test's threshold by evidently's drift rule. | NULL | [column_drift_agg(value, group_id, {'test': 'auto', 'threshold': 0.05})] |
| column_drift_agg | aggregate | evidently's drift of one column: runs the named test (or evidently's default choice for 'auto', by reference size, number of distinct values and column type) and compares the score (a p-value or a distance) with the test's threshold by evidently's drift rule. Default options. | NULL | [column_drift_agg(value, group_id)] |
| concordance_agg | aggregate | Concordance of the prediction x with the ordered response y (survival::concordance): pair counts concordant, discordant, tied_x, tied_y, tied_xy (weighted by w_i w_j), the concordance probability c, Somers' dxy, Goodman-Kruskal gamma and Kendall tau_a (the rank statistics of rms::lrm / orm). | NULL | [concordance_agg(y, prediction)] |
| condition_diagnostic_agg | aggregate | Belsley-Kuh-Welsch collinearity diagnostics of the design [1, x] (perturb::colldiag, olsrr::ols_eigen_cindex): condition indices and variance-decomposition proportions of the unit-column-length design, plus kappa(X, exact = TRUE) of the unscaled design. | NULL | [condition_diagnostic_agg([x1, x2, x3])] |
| condition_diagnostic_agg | aggregate | Belsley-Kuh-Welsch collinearity diagnostics of the design [1, x] (perturb::colldiag, olsrr::ols_eigen_cindex): condition indices and variance-decomposition proportions of the unit-column-length design, plus kappa(X, exact = TRUE) of the unscaled design. | NULL | [condition_diagnostic_agg([x1, x2, x3], {'fit_intercept': false})] |
| contingency_coef_agg | aggregate | Computes the contingency coefficient (C), a measure of association for categorical variables. | NULL | [contingency_coef_agg(row_var, col_var)] |
| continuation_ratio_fit_agg | aggregate | Fits the continuation-ratio ordinal model logit P(Y = y_j \| Y >= y_j, x) = theta_j + x'gamma (rms cr.setup + lrm; at least three levels). Returns STRUCT(levels, coefficients (intercept theta_1, cohort effects theta_j - theta_1 for j = 2..k-1, slopes, then each cohort-specific column's slope differences), std_errors, z_values, p_values, cohort_specific, log_likelihood, aic, n_levels, n_observations, n_records, n_features, iterations, converged, model_type, link). Option: cohort_specific (1-based x columns whose slope varies by cohort). | NULL | [continuation_ratio_fit_agg(stage, [age, dose])] |
| continuation_ratio_fit_agg | aggregate | Fits the continuation-ratio ordinal model logit P(Y = y_j \| Y >= y_j, x) = theta_j + x'gamma (rms cr.setup + lrm; at least three levels). Returns STRUCT(levels, coefficients (intercept theta_1, cohort effects theta_j - theta_1 for j = 2..k-1, slopes, then each cohort-specific column's slope differences), std_errors, z_values, p_values, cohort_specific, log_likelihood, aic, n_levels, n_observations, n_records, n_features, iterations, converged, model_type, link). Option: cohort_specific (1-based x columns whose slope varies by cohort). | NULL | [continuation_ratio_fit_agg(stage, [age, dose], {'cohort_specific': [2]})] |
| continuation_ratio_fit_agg | aggregate | Fits the same continuation-ratio model with non-negative case weights (a numeric third argument is the weight); a NULL weight leaves the row out. | NULL | [continuation_ratio_fit_agg(stage, [age, dose], w, {'cohort_specific': [2]})] |
| continuation_ratio_fit_predict_by | table_macro | Table macro: fits a continuation-ratio model (continuation_ratio_fit_agg, options as there) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (the most probable level), yhat_mean (the predicted mean), probabilities (DOUBLE[] in the order of the model's levels) and is_training appended. | NULL | [continuation_ratio_fit_predict_by('ratings', site, rating, [age, dose])] |
| contrast_agg | aggregate | Contrast between two predictor settings, as rms contrast(fit, a, b): the difference of the linear predictor at a and at b (STRUCTs or MAPs {predictor: value}; unset predictors at their datadist adjust-to values) with estimate, std_error, conf_low, conf_high, statistic, p_value, conf_level. Options: level, critical. | NULL | [contrast_agg([age, sex], m, terms, {'age': 60}, {'age': 45})] |
| count_sparsity_agg | aggregate | Count-data sparsity check for Poisson / negative binomial models: flags indicator predictors whose active rows all have a zero response when more than 90% of the counts are zero. | NULL | [count_sparsity_agg(y, [x1, x2])] |
| cox_augment_agg | aggregate | Window aggregate: fits the same Cox model as cox_fit_agg over the frame and returns one STRUCT per input row (in frame order): linear_predictor, risk, martingale / deviance residuals, score, dfbeta, dfbetas and (event rows) Schoenfeld residuals, stratum, is_training. Use it over a whole partition, as cox_augment_by does. | NULL | [cox_augment_agg(time, [x1, x2], event)] |
| cox_augment_agg | aggregate | Window aggregate: fits the same Cox model as cox_fit_agg over the frame and returns one STRUCT per input row (in frame order): linear_predictor, risk, martingale / deviance residuals, score, dfbeta, dfbetas and (event rows) Schoenfeld residuals, stratum, is_training. Use it over a whole partition, as cox_augment_by does. With a MAP / STRUCT of options (ties, ridge, robust, offset, strata, entry, cluster, ...), or with a numeric case weight as 4th argument. | NULL | [cox_augment_agg(time, [x1, x2], event, {'ties': 'breslow'})] |
| cox_augment_agg | aggregate | Window aggregate: fits the same Cox model as cox_fit_agg over the frame and returns one STRUCT per input row (in frame order): linear_predictor, risk, martingale / deviance residuals, score, dfbeta, dfbetas and (event rows) Schoenfeld residuals, stratum, is_training. Use it over a whole partition, as cox_augment_by does. With case weights w (coxph(weights = w)) and options. | NULL | [cox_augment_agg(time, [x1, x2], event, w, {'robust': true})] |
| cox_augment_by | table_macro | Table macro: fits a Cox proportional hazards model (cox_augment_agg, same options as cox_fit_agg) per group of source and returns every source row with its per-observation results (the integration contract's `obs` schema, broom augment.coxph): all source columns, model_id and model_name ('cox'), row_id, fitted (the linear predictor x'beta + offset, not centred), residual (martingale), resid_type ('martingale'), std_residual, stud_residual, leverage, cooks_d, dffits (NULL), weight (1), is_training, n_params (NULL), then risk (exp(fitted)), deviance_residual, score_residuals, dfbeta, dfbetas, schoenfeld_residuals and scaled_schoenfeld_residuals (event rows only) and stratum. Rows the fit could not use get NULLs. | NULL | [cox_augment_by('patients', site, days, [age, treated], died)] |
| cox_fit_agg | aggregate | Fits a Cox proportional hazards model (survival::coxph; Efron or Breslow ties) to right-censored or counting-process survival data (event = 1 observed, 0 censored): log hazard ratios, hazard ratios with Wald intervals, likelihood-ratio / Wald / score tests, concordance and the baseline cumulative hazard. | NULL | [cox_fit_agg(time, [x1, x2], event)] |
| cox_fit_agg | aggregate | Fits a Cox proportional hazards model (survival::coxph; Efron or Breslow ties) to right-censored or counting-process survival data (event = 1 observed, 0 censored): log hazard ratios, hazard ratios with Wald intervals, likelihood-ratio / Wald / score tests, concordance and the baseline cumulative hazard. With a MAP / STRUCT of options (ties, ridge, robust, offset, strata, entry, cluster, ...), or with a numeric case weight as 4th argument. | NULL | [cox_fit_agg(time, [x1, x2], event, {'ties': 'breslow'})] |
| cox_fit_agg | aggregate | Fits a Cox proportional hazards model (survival::coxph; Efron or Breslow ties) to right-censored or counting-process survival data (event = 1 observed, 0 censored): log hazard ratios, hazard ratios with Wald intervals, likelihood-ratio / Wald / score tests, concordance and the baseline cumulative hazard. With case weights w (coxph(weights = w)) and options. | NULL | [cox_fit_agg(time, [x1, x2], event, w, {'robust': true})] |
| cox_fit_by | table_macro | Table macro: fits a Cox proportional hazards model (cox_fit_agg, same options) per group of source and returns one row per group: the group column, then the fields of the model STRUCT (coefficients, hazard_ratios, hr_conf_low, hr_conf_high, the likelihood-ratio / Wald / score tests, concordance, baseline, ...). | NULL | [cox_fit_by('patients', site, days, [age, treated], died)] |
| cox_glance_by | table_macro | Table macro: fits a Cox proportional hazards model (coefficients are log hazard ratios) per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [cox_glance_by('my_table', group_col, y, [x1, x2], event)] |
| cox_survival | scalar | Predicted survival curve S(t \| x) of a fitted Cox model (the STRUCT returned by cox_fit_agg) for the covariate row x at each of times (survfit(fit, newdata) point estimate, from the stored baseline cumulative hazard): one {time, surv} per time. | NULL | [cox_survival(m, [60.0, 1.0], [100, 365, 730])] |
| cox_survival | scalar | Predicted survival curve S(t \| x) of a fitted Cox model (the STRUCT returned by cox_fit_agg) for the covariate row x at each of times (survfit(fit, newdata) point estimate, from the stored baseline cumulative hazard): one {time, surv} per time. For a stratified model, stratum picks the stratum's baseline. | NULL | [cox_survival(m, [60.0], [100, 365], 2)] |
| cox_tidy_by | table_macro | Table macro: fits a Cox proportional hazards model (coefficients are log hazard ratios) per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [cox_tidy_by('my_table', group_col, y, [x1, x2], event, names := ['x1', 'x2'])] |
| cox_zph_agg | aggregate | Grambsch-Therneau test of proportional hazards of a Cox model (survival::cox.zph): one {term, statistic, df, p_value} per covariate and a GLOBAL row; option transform: km (default), rank, identity, log. | NULL | [cox_zph_agg(time, [x1, x2], event)] |
| cox_zph_agg | aggregate | Grambsch-Therneau test of proportional hazards of a Cox model (survival::cox.zph): one {term, statistic, df, p_value} per covariate and a GLOBAL row; option transform: km (default), rank, identity, log. With a MAP / STRUCT of options (ties, ridge, robust, offset, strata, entry, cluster, ...), or with a numeric case weight as 4th argument. | NULL | [cox_zph_agg(time, [x1, x2], event, {'ties': 'breslow'})] |
| cox_zph_agg | aggregate | Grambsch-Therneau test of proportional hazards of a Cox model (survival::cox.zph): one {term, statistic, df, p_value} per covariate and a GLOBAL row; option transform: km (default), rank, identity, log. With case weights w (coxph(weights = w)) and options. | NULL | [cox_zph_agg(time, [x1, x2], event, w, {'robust': true})] |
| cramers_v_agg | aggregate | Computes Cramér's V, a measure of association strength for nominal categorical variables. | NULL | [cramers_v_agg(row_var, col_var)] |
| cvm_test_agg | aggregate | Two-sample Cramer-von Mises test (Anderson's T): exact permutation p-value when max(n1, n2) <= 20, otherwise the limiting distribution. | NULL | [cvm_test_agg(value, group_id, {'method': 'auto'})] |
| cvm_test_agg | aggregate | Two-sample Cramer-von Mises test (Anderson's T): exact permutation p-value when max(n1, n2) <= 20, otherwise the limiting distribution. Default options. | NULL | [cvm_test_agg(value, group_id)] |
| dagostino_k2_agg | aggregate | Performs the D'Agostino-Pearson K² omnibus normality test based on skewness and kurtosis. | NULL | [dagostino_k2_agg(value)] |
| dataset_drift_agg | aggregate | evidently's dataset drift over per-column drift flags (e.g. (column_drift_agg(...)).drifted): the dataset drifted when the share of drifted columns is at least drift_share (default 0.5). NULL flags are skipped. | NULL | [dataset_drift_agg(drifted, 0.5)] |
| dataset_drift_by | table_macro | Table macro: evidently's data drift of a table. group_col splits the reference and the current rows (two labels; the reference is the smaller label unless options.reference names it); every column named in columns is tested with column_drift_agg(options) (numeric columns as numbers, other types as categories) and the dataset drifted when the share of drifted columns is at least drift_share (default 0.5). Returns one row per column: column_name, test, score, is_p_value, threshold, drifted, n1, n2, plus the dataset summary n_columns, n_drifted, share_drifted, drift_share, dataset_drift. | NULL | [dataset_drift_by('events', is_current, ['age', 'city'])] |
| default_knot_quantiles | scalar | Default knot quantiles of a restricted cubic spline with nk knots (RMS Table 2.3, Hmisc::rcspline.eval). | NULL | [default_knot_quantiles(5)] |
| detect_separation_agg | aggregate | Exact check for (quasi-)complete separation of a binary (0/1) response by the linear program of Konis (2007), as R's detectseparation::detect_separation: whether the logistic MLE exists, and which coefficients diverge to +-Inf. | NULL | [detect_separation_agg(y, [x1, x2])] |
| detect_separation_agg | aggregate | Exact check for (quasi-)complete separation of a binary (0/1) response by the linear program of Konis (2007), as R's detectseparation::detect_separation: whether the logistic MLE exists, and which coefficients diverge to +-Inf. | NULL | [detect_separation_agg(y, [x1, x2], {'fit_intercept': false})] |
| diebold_mariano_agg | aggregate | Performs the Diebold-Mariano test to compare predictive accuracy of two forecast models, using default options. | NULL | [diebold_mariano_agg(actual, forecast1, forecast2)] |
| diebold_mariano_agg | aggregate | Performs the Diebold-Mariano test to compare predictive accuracy of two forecast models. | NULL | [diebold_mariano_agg(actual, forecast1, forecast2, {'loss': 'squared'})] |
| distance_cor_agg | aggregate | Computes the distance correlation between two variables, detecting both linear and nonlinear dependence, using default options. | NULL | [distance_cor_agg(x, y)] |
| distance_cor_agg | aggregate | Computes the distance correlation between two variables, detecting both linear and nonlinear dependence. | NULL | [distance_cor_agg(x, y, {'n_permutations': 1000})] |
| double_contrast_agg | aggregate | Double-difference contrast (a - b) - (a2 - b2), as rms contrast(fit, a, b, a2, b2), e.g. an interaction effect. Same result as contrast_agg. Options: level, critical. | NULL | [double_contrast_agg([age, sex], m, terms, {'age': 60, 'sex': 1}, {'age': 45, 'sex': 1}, {'age': 60, 'sex': 0}, {'age': 45, 'sex': 0})] |
| dunn_test_agg | aggregate | Dunn's test for all pairwise differences of mean ranks after Kruskal-Wallis (FSA::dunnTest). Returns one row per pair: estimate (mean rank of group2 - group1), statistic (z for group2 - group1), p_value, p_adj. Options: p_adjust (holm [default], hochberg, hommel, bonferroni, BH/fdr, BY, none). | NULL | [dunn_test_agg(value, group, {'p_adjust': 'holm'})] |
| dunn_test_by | table_macro | Table macro: runs Dunn's rank test with p-value adjustment (FSA::dunnTest) between the levels of factor_col within each group of source and returns one row per pair (the integration contract's `test` schema): the group column, model_id, test_id ('-'), method, statistic, p_value, group1, group2, p_adj, df1, df2, estimate, conf_low, conf_high, conf_level, effect_size, effect_name, alternative, p_adjust_method. options are passed to dunn_test_agg. | NULL | [dunn_test_by('my_table', experiment, response, treatment)] |
| durbin_watson_agg | aggregate | Durbin-Watson statistic sum((e_t - e_{t-1})^2) / sum(e_t^2) of residuals in the aggregate's ORDER BY order (the statistic of R lmtest::dwtest). p_value is NULL here: pass the regressors, durbin_watson_agg(resid, x ORDER BY t), for the test with a p-value. | NULL | [durbin_watson_agg(resid ORDER BY t)] |
| durbin_watson_agg | aggregate | Durbin-Watson test for first-order autocorrelation of regression residuals in the aggregate's ORDER BY order, with the p-value of R lmtest::dwtest: x are the model's regressors (an intercept column is added unless fit_intercept is false). The p-value is exact (Imhof) for n < 100, else the normal approximation. alternative: 'greater' (default, positive autocorrelation), 'less' or 'two_sided'. | NULL | [durbin_watson_agg(resid, [x1, x2] ORDER BY t)] |
| eb_shrink_agg | aggregate | Empirical-Bayes (random-effects) shrinkage of per-group estimates with standard errors toward their precision-weighted mean; returns the shrunken estimates with mu and tau_squared. | NULL | [eb_shrink_agg(estimate, se)] |
| eb_shrink_agg | aggregate | Empirical-Bayes shrinkage of per-group estimates with a MAP of options (tau_squared, tau_method). | NULL | [eb_shrink_agg(estimate, se, {'tau_method': 'dl'})] |
| eb_shrink_by | table_macro | Table macro: empirical-Bayes shrinkage of the estimates in estimate_col (standard errors in se_col); returns every source row with shrunken, shrunken_se, weight, mu and tau_squared appended. | NULL | [eb_shrink_by('my_table', estimate, se)] |
| effects_design | scalar | Design row (no intercept) of the raw predictor values x (one per predictor term, in term order) for an effects term list: the main-effect bases in term order, then the interactions. Fit a model on it to use effects_summary_agg, contrast_agg, predict_grid_agg and nomogram_agg. | NULL | [effects_design([age, sex], [effects_term('age', spline_spec('rcs', [30.0, 45.0, 60.0])), effects_term('sex', 'categorical', [0, 1])])] |
| effects_interaction | scalar | An interaction term between the predictors a and b: the full tensor product (rms a * b), or with restricted = true the restricted interaction a %ia% b (no doubly nonlinear products). | NULL | [effects_interaction('age', 'bmi', true)] |
| effects_interaction | scalar | An interaction term between the predictors a and b: the full tensor product (rms a * b), or with restricted = true the restricted interaction a %ia% b (no doubly nonlinear products). | NULL | [effects_interaction('age', 'sex')] |
| effects_summary_agg | aggregate | Partial effects as rms summary(fit): for each numeric predictor the effect of going from its lower to its upper quartile, for each categorical predictor every level against the most frequent one, others at their medians / modes (datadist of the rows of x). One element per effect: term, label, low, high, diff, estimate, std_error, conf_low, conf_high, statistic, p_value, ratio, ratio_low, ratio_high (exp: odds / rate ratios, for log / logit links or with ratio := true), conf_level. Options: level (0.95), critical ('auto': t for linear models, normal otherwise \| 'normal' \| 't'), ratio. | NULL | [effects_summary_agg([age, sex], m, terms)] |
| effects_term | scalar | A predictor term of an effects model specification: effects_term(name, 'linear' \| 'categorical' [, levels]) or effects_term(name, spline_spec('rcs' \| 'lsp', knots)). Returns {name, kind, knots, norm, levels, a, b}. A categorical term is coded with treatment contrasts (a dummy per level but the first); its levels are required by effects_design. | NULL | [effects_term('age', spline_spec('rcs', [30.0, 45.0, 60.0]))] |
| effects_term | scalar | A predictor term of an effects model specification: effects_term(name, 'linear' \| 'categorical' [, levels]) or effects_term(name, spline_spec('rcs' \| 'lsp', knots)). Returns {name, kind, knots, norm, levels, a, b}. A categorical term is coded with treatment contrasts (a dummy per level but the first); its levels are required by effects_design. | NULL | [effects_term('sex', 'categorical', [0, 1])] |
| elasticnet_cv_agg | aggregate | k-fold cross-validation of the elastic-net path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). | NULL | [elasticnet_cv_agg(y, [x1, x2])] |
| elasticnet_cv_agg | aggregate | k-fold cross-validation of the elastic-net path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). | NULL | [elasticnet_cv_agg(y, [x1, x2], {'l1_ratio': 0.5, 'folds': 5})] |
| elasticnet_cv_agg | aggregate | k-fold cross-validation of the elastic-net path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). With cv_key, the folds follow cv_strategy: 'fold_id' (default; cv_key is each row's fold, any labels, at least 3), 'group' (cv_key is a group that never spans two folds; a STRUCT of several columns for a combined key), 'logo' (leave one group out), 'stratified' (cv_key is the stratum) or 'time_series' (cv_key is the time: rolling-origin splits with test_size, gap, window, max_train_size). | NULL | [elasticnet_cv_agg(y, [x1, x2], store, {'cv_strategy': 'group', 'folds': 5})] |
| elasticnet_cv_by | table_macro | Table macro: computes the k-fold cross-validation curve of the elastic-net path (cv.glmnet) per group of source with elasticnet_cv_agg (same options) and returns one row per lambda in the integration contract's `curve` schema: the group column, id (the group), model_id and model_name (the method), curve_type ('lambda_cv'), series, x (lambda), y (cv_mean), y_low, y_high (cv_mean -/+ cv_se), threshold, weight, n_censor, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds. cv_key := column (or a STRUCT of columns) passes the cv_key of the cv_strategy option. | NULL | [elasticnet_cv_by('my_table', group_col, y, [x1, x2])] |
| elasticnet_fit | scalar | Fits an ElasticNet regression model (L1+L2 regularization) with optional MAP of settings (fit_intercept, alpha, l1_ratio, max_iterations, tolerance). | NULL | [elasticnet_fit(y, x, {'alpha': 1.0, 'l1_ratio': 0.5})] |
| elasticnet_fit | scalar | Fits an ElasticNet regression model combining L1 and L2 regularization to the given response and feature data. | NULL | [elasticnet_fit(y, x)] |
| elasticnet_fit_agg | aggregate | Fits an ElasticNet model combining L1 and L2 regularization and returns coefficients and fit statistics. | NULL | [elasticnet_fit_agg(y, x)] |
| elasticnet_fit_agg | aggregate | Fits an ElasticNet model combining L1 and L2 regularization and returns coefficients and fit statistics. | NULL | [elasticnet_fit_agg(y, x, {'alpha': 1.0, 'l1_ratio': 0.5})] |
| elasticnet_fit_predict | aggregate | Window aggregate: fits an ElasticNet regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use elasticnet_fit_predict_agg. | NULL | [elasticnet_fit_predict(y, x)] |
| elasticnet_fit_predict | aggregate | Window aggregate: fits an ElasticNet regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use elasticnet_fit_predict_agg. | NULL | [elasticnet_fit_predict(y, x, {'null_policy': 'drop'})] |
| elasticnet_fit_predict_agg | aggregate | Fits ElasticNet regression on training rows with a MAP of options and predicts all rows. | NULL | [elasticnet_fit_predict_agg(y, x, split_col, {'null_policy': 'drop'})] |
| elasticnet_fit_predict_agg | aggregate | Fits ElasticNet regression over a partition and returns per-row predictions with prediction intervals. | NULL | [elasticnet_fit_predict_agg(y, x)] |
| elasticnet_fit_predict_agg | aggregate | Fits ElasticNet regression over a partition with a MAP of options and returns per-row predictions with prediction intervals. | NULL | [elasticnet_fit_predict_agg(y, x, {'null_policy': 'drop'})] |
| elasticnet_fit_predict_agg | aggregate | Fits ElasticNet regression using only training rows (split_col='train') and predicts all rows. | NULL | [elasticnet_fit_predict_agg(y, x, split_col)] |
| elasticnet_fit_predict_by | table_macro | Table macro: fits an ElasticNet regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [elasticnet_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| elasticnet_glance_by | table_macro | Table macro: fits an Elastic Net regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [elasticnet_glance_by('my_table', group_col, y, [x1, x2])] |
| elasticnet_nested_cv_agg | aggregate | Nested cross-validation of the elastic-net path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). | NULL | [elasticnet_nested_cv_agg(y, [x1, x2])] |
| elasticnet_nested_cv_agg | aggregate | Nested cross-validation of the elastic-net path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). | NULL | [elasticnet_nested_cv_agg(y, [x1, x2], store, {'cv_strategy': 'group', 'rule': '1se'})] |
| elasticnet_nested_cv_agg | aggregate | Nested cross-validation of the elastic-net path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). With cv_key, the folds follow cv_strategy: 'fold_id' (default; cv_key is each row's fold, any labels, at least 3), 'group' (cv_key is a group that never spans two folds; a STRUCT of several columns for a combined key), 'logo' (leave one group out), 'stratified' (cv_key is the stratum) or 'time_series' (cv_key is the time: rolling-origin splits with test_size, gap, window, max_train_size). | NULL | [elasticnet_nested_cv_agg(y, [x1, x2], store, {'cv_strategy': 'group', 'folds': 5})] |
| elasticnet_nested_cv_by | table_macro | Table macro: computes the nested cross-validation of the elastic-net path per group of source with elasticnet_nested_cv_agg (same options) and returns one row per outer fold plus a summary row in the integration contract's `curve` schema: the group column, id (the group), model_id and model_name (the method), curve_type ('nested_cv'), series ('fold' \| 'mean'), x (fold), y (test error), y_low, y_high (mean -/+ se on the summary row), threshold, weight, n_censor, fold, lambda, test_error, test_se, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds, n_folds, metric. cv_key := column (or a STRUCT of columns) passes the cv_key. | NULL | [elasticnet_nested_cv_by('my_table', group_col, y, [x1, x2])] |
| elasticnet_path_agg | aggregate | Elastic-net coefficient path per group, as glmnet(alpha = l1_ratio) (default l1_ratio 0.5). Returns a LIST of `terms` rows (term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name = 'lambda', index_value = lambda), one per lambda and term, intercept first. Options: lambdas (default glmnet's grid), n_lambda (100), lambda_min_ratio, standardize (false), fit_intercept, feature_names. | NULL | [elasticnet_path_agg(y, [x1, x2])] |
| elasticnet_path_agg | aggregate | Elastic-net coefficient path per group, as glmnet(alpha = l1_ratio) (default l1_ratio 0.5). Returns a LIST of `terms` rows (term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name = 'lambda', index_value = lambda), one per lambda and term, intercept first. Options: lambdas (default glmnet's grid), n_lambda (100), lambda_min_ratio, standardize (false), fit_intercept, feature_names. | NULL | [elasticnet_path_agg(y, [x1, x2], {'l1_ratio': 0.5, 'lambdas': [1.0, 0.1, 0.01]})] |
| elasticnet_path_by | table_macro | Table macro: computes the elastic-net coefficient path (glmnet, l1_ratio = alpha) per group of source with elasticnet_path_agg (same options) and returns one row per index value and term in the `terms` schema: the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('lambda'), index_value. names := [...] labels the terms. | NULL | [elasticnet_path_by('my_table', group_col, y, [x1, x2])] |
| elasticnet_prediction_by | table_macro | Table macro: fits an Elastic Net regression per group of source (elasticnet_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('elasticnet'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [elasticnet_prediction_by('sales', store, week, revenue, [price, promo])] |
| elasticnet_rolling_tidy_by | table_macro | Table macro: fits an Elastic Net regression over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [elasticnet_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], window_size := 24)] |
| elasticnet_tidy_by | table_macro | Table macro: fits an Elastic Net regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model has no coefficient inference. names := [...] labels the terms. | NULL | [elasticnet_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| embedding_drift_agg | aggregate | evidently's embedding drift of the current group against the reference: 'distance' between the mean embeddings (euclidean, cosine, cityblock, chebyshev; threshold 0.2), 'ratio' (share of drifted components by a per-component drift test; threshold 0.2) or 'mmd' (squared maximum mean discrepancy with the median bandwidth; threshold 0.015), with a fixed or bootstrapped threshold. group_id is a label (the reference is the smaller one unless options.reference names it) or a BOOLEAN is_reference. | NULL | [embedding_drift_agg(embedding, is_reference, {'method': 'distance', 'metric': 'cosine'})] |
| embedding_drift_agg | aggregate | evidently's embedding drift of the current group against the reference: 'distance' between the mean embeddings (euclidean, cosine, cityblock, chebyshev; threshold 0.2), 'ratio' (share of drifted components by a per-component drift test; threshold 0.2) or 'mmd' (squared maximum mean discrepancy with the median bandwidth; threshold 0.015), with a fixed or bootstrapped threshold. group_id is a label (the reference is the smaller one unless options.reference names it) or a BOOLEAN is_reference. Default options. | NULL | [embedding_drift_agg(embedding, is_reference)] |
| energy_distance_agg | aggregate | Computes the energy distance between two samples as a measure of distributional difference, using default options. | NULL | [energy_distance_agg(value, group_id)] |
| energy_distance_agg | aggregate | Computes the energy distance between two samples as a measure of distributional difference. | NULL | [energy_distance_agg(value, group_id, {'n_permutations': 1000})] |
| energy_distance_test_agg | aggregate | Multivariate energy distance two-sample test (Szekely and Rizzo) of two groups of equal-length vectors, with a seeded permutation p-value. | NULL | [energy_distance_test_agg(x, group_id, {'n_permutations': 999, 'seed': 42})] |
| energy_distance_test_agg | aggregate | Multivariate energy distance two-sample test (Szekely and Rizzo) of two groups of equal-length vectors, with a seeded permutation p-value. Default options. | NULL | [energy_distance_test_agg(x, group_id)] |
| epps_singleton_agg | aggregate | Epps-Singleton two-sample test based on the empirical characteristic function (scipy epps_singleton_2samp). | NULL | [epps_singleton_agg(value, group_id, {'t': [0.4, 0.8]})] |
| epps_singleton_agg | aggregate | Epps-Singleton two-sample test based on the empirical characteristic function (scipy epps_singleton_2samp). Default options. | NULL | [epps_singleton_agg(value, group_id)] |
| fastbw | scalar | Fast backward step-down (rms::fastbw, Lawless & Singhal) from a fitted model's coefficients and covariance: the deletion order with the Wald and residual chi-square tests, the kept terms, the approximate reduced-model coefficients and their covariance (vcov, fastbw's var; kept_parameters: 1-based positions in the vcov layout, fastbw's parms.kept). Coefficients with a NULL term label are never deleted. options: rule ('aic' \| 'p'), type ('residual' \| 'individual'), sls, aics, k_aic. | NULL | [fastbw(logistic_fit_agg(y, [x1, x2, x3], {'compute_inference': true}))] |
| fisher_exact_agg | aggregate | Performs Fisher's exact test for association in a 2×2 contingency table. | NULL | [fisher_exact_agg(row_var, col_var)] |
| fisher_exact_agg | aggregate | Performs Fisher's exact test for association in a 2×2 contingency table. | NULL | [fisher_exact_agg(row_var, col_var, {'alternative': 'two_sided'})] |
| g_drift_agg | aggregate | G (log-likelihood ratio) goodness-of-fit test of the current category counts against the reference shares (evidently 'g_test', expected counts scaled to the current size). | NULL | [g_drift_agg(value, group_id, {'reference': 0})] |
| g_drift_agg | aggregate | G (log-likelihood ratio) goodness-of-fit test of the current category counts against the reference shares (evidently 'g_test', expected counts scaled to the current size). Default options. | NULL | [g_drift_agg(value, group_id)] |
| g_test_agg | aggregate | Performs a G-test (log-likelihood ratio test) for goodness of fit or independence. | NULL | [g_test_agg(row_var, col_var)] |
| gamma_augment_agg | aggregate | Fits a Gamma GLM (log link) over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [gamma_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| gamma_augment_agg | aggregate | Fits a Gamma GLM (log link) over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [gamma_augment_agg(y, [x1, x2], {'fit_intercept': true}) OVER ()] |
| gamma_augment_by | table_macro | Table macro: fits a Gamma GLM (log link) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [gamma_augment_by('my_table', group_col, y, [x1, x2])] |
| gamma_effects_by | table_macro | Table macro: marginal-effect grid of a Gamma GLM per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of gamma_tidy_by). | NULL | [gamma_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| gamma_fit_agg | aggregate | Fits a Gamma GLM (log link, var_power = 2.0 fixed) and returns coefficients, deviance, AIC, dispersion, and fit statistics. | NULL | [gamma_fit_agg(y, x)] |
| gamma_fit_agg | aggregate | Fits a Gamma GLM (log link, var_power = 2.0 fixed) and returns coefficients, deviance, AIC, dispersion, and fit statistics. y must be strictly positive. | NULL | [gamma_fit_agg(y, x, {'fit_intercept': true})] |
| gamma_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [gamma_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| gamma_fit_agg | aggregate | Fits the same model with prior (case) weights w, as R's glm(weights = w); a NULL weight drops the row. | NULL | [gamma_fit_agg(y, x, w), gamma_fit_agg(y, x, w, {'compute_inference': true})] |
| gamma_fit_predict_by | table_macro | Table macro: fits a Gamma GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [gamma_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| gamma_glance_by | table_macro | Table macro: fits a Gamma GLM per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [gamma_glance_by('my_table', group_col, y, [x1, x2])] |
| gamma_partial_residuals_agg | aggregate | Fits a Gamma GLM (log link) over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [gamma_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| gamma_partial_residuals_by | table_macro | Table macro: fits a Gamma GLM per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [gamma_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| gamma_prediction_by | table_macro | Table macro: fits a Gamma GLM per group of source (gamma_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('gamma'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [gamma_prediction_by('sales', store, week, revenue, [price, promo])] |
| gamma_tidy_by | table_macro | Table macro: fits a Gamma GLM per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [gamma_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| gini_md_agg | aggregate | Gini's mean difference sum_{i != j} \|x_i - x_j\| / (n (n - 1)) (Hmisc::GiniMd); the g-index when x is a linear predictor. NULL for fewer than 2 values or a NaN value. | NULL | [gini_md_agg(lp)] |
| glance | scalar | Model-level summary with the same fields for every model: model_type, family, link, n_observations, n_features, r_squared, adj_r_squared, residual_std_error, f_statistic, f_pvalue, log_likelihood, aic, bic, deviance, null_deviance, pseudo_r_squared, dispersion, iterations, converged, press, press_rmse, loo_r_squared. Fields a model does not have are NULL. | NULL | [glance(ols_fit_agg(y, [x1, x2])).*] |
| glm_score_test_agg | aggregate | Rao score test per group for adding the x_add predictors to the GLM of y on x_reduced (R's anova(reduced, full, test = 'Rao')), evaluated at the reduced fit. Returns the chi-square statistic, df1, p_value and the per-column z_values. Options: family ('gaussian' default, 'binomial', 'poisson', 'negbinom', 'gamma', 'tweedie'), link, power (tweedie), theta (negbinom; estimated from the reduced fit when omitted), fit_intercept, offset (1-based column of x_reduced). x_reduced := [] is the intercept-only model. | NULL | [glm_score_test_agg(y, [x1], [x2, x3])] |
| glm_score_test_agg | aggregate | Rao score test per group for adding the x_add predictors to the GLM of y on x_reduced (R's anova(reduced, full, test = 'Rao')), evaluated at the reduced fit. Returns the chi-square statistic, df1, p_value and the per-column z_values. Options: family ('gaussian' default, 'binomial', 'poisson', 'negbinom', 'gamma', 'tweedie'), link, power (tweedie), theta (negbinom; estimated from the reduced fit when omitted), fit_intercept, offset (1-based column of x_reduced). x_reduced := [] is the intercept-only model. | NULL | [glm_score_test_agg(y, [x1], [x2, x3], {'family': 'poisson'})] |
| glm_score_test_by | table_macro | Table macro: Rao score test per group of source for adding the x_add predictors to the GLM of y on x_reduced (R's anova(reduced, full, test = 'Rao')); returns one row per group with method 'Rao score', statistic, p_value, df1, the per-column z_values, dispersion, theta and n_observations. options as glm_score_test_agg (family, link, power, theta, fit_intercept, offset). x_reduced := [] (the default) is the intercept-only model. | NULL | [glm_score_test_by('claims', region, n_claims, x_reduced := [age], x_add := [bonus, urban], options := {'family': 'poisson'})] |
| glmm_augment_agg | aggregate | Window aggregate: fits the same mixed model as glmm_fit_agg over the frame and returns one STRUCT per input row (in frame order) with fitted (conditional on the BLUPs, response scale), fitted_population (random effects at zero), residual (y - fitted), pearson_residual and is_training. Use it over a whole partition, as glmm_augment_by does. | NULL | [glmm_augment_agg(y, [x1, x2], store_id) OVER ()] |
| glmm_augment_agg | aggregate | Window aggregate: fits the same mixed model as glmm_fit_agg over the frame and returns one STRUCT per input row (in frame order) with fitted (conditional on the BLUPs, response scale), fitted_population (random effects at zero), residual (y - fitted), pearson_residual and is_training. Use it over a whole partition, as glmm_augment_by does. | NULL | [glmm_augment_agg(y, [x1, x2], store_id, {'family': 'poisson'}) OVER ()] |
| glmm_augment_by | table_macro | Table macro: fits one generalized linear mixed model (glmm_augment_agg, random effects over re_group) per group_col and returns every source row with its per-observation results (the integration contract's `obs` schema, broom.mixed::augment): all source columns, model_id and model_name ('glmm'), row_id, fitted (conditional on the BLUPs, response scale), residual (y - fitted), resid_type ('response'), std_residual, stud_residual, leverage, cooks_d, dffits (NULL), weight, is_training, n_params (NULL), then fitted_population (random effects at zero) and pearson_residual. Rows the fit could not use get NULLs. | NULL | [glmm_augment_by('sales', region, revenue, [price], store)] |
| glmm_fit_agg | aggregate | Fits a generalized linear mixed model with a MAP of options (family, reml, random slopes, crossed groups, compute_inference, ...). | NULL | [glmm_fit_agg(y, [x1, x2], store_id, {'family': 'poisson'})] |
| glmm_fit_agg | aggregate | Fits a generalized linear mixed model with a random intercept per group (one model across all groups); returns fixed effects, variance components and per-group random effects. | NULL | [glmm_fit_agg(y, [x1, x2], store_id)] |
| glmm_fit_by | table_macro | Table macro: fits one generalized linear mixed model (random intercept per group_col) over the whole table and returns one row per group with its random effect and the fixed effects and variance components. | NULL | [glmm_fit_by('my_table', group_col, y, [x1, x2])] |
| glmm_glance_by | table_macro | Table macro: fits one generalized linear mixed model (glmm_fit_agg, random effects over re_group) per group_col and returns its fit statistics in long form (the integration contract's `summary` schema, broom.mixed::glance): the group column, id (the group), model_id and model_name ('glmm'), model_type, metric, value. Metrics: n_observations, n_groups, n_features, sigma, log_likelihood, aic, bic, deviance (the REML criterion for a REML fit), df_residual, var_group, var_residual, icc, nb_theta (negative binomial), converged (1/0), iterations. | NULL | [glmm_glance_by('sales', region, revenue, [price], store)] |
| glmm_tidy_by | table_macro | Table macro: fits one generalized linear mixed model (glmm_fit_agg, random effects over re_group) per group_col and returns its terms (the integration contract's `terms` schema, broom.mixed::tidy): the group column, id (the group), model_id and model_name ('glmm'), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value, then effect ('fixed', 'ran_pars', 'ran_vals'), re_group, re_level and df. Fixed effects carry Wald z or, for gaussian, Satterthwaite t inference (option ddf; inference is always computed); ran_pars rows are the random-effect SDs (sd__), correlations (cor__.) and the residual SD; ran_vals rows are the BLUPs with their conditional standard errors and normal intervals. names := [...] labels the fixed-effect columns, re_names := [...] the random effects' grouping factors (default 'group'). | NULL | [glmm_tidy_by('sales', region, revenue, [price], store, names := ['price'])] |
| gls_augment_agg | aggregate | Window aggregate: fits the same GLS model as gls_fit_agg over the frame and returns one STRUCT per input row (in frame order): fitted (x'b for every row with x), se_fit, residual, pearson_residual, normalized_residual and is_training. Use it over a whole partition, as gls_augment_by does. | NULL | [gls_augment_agg(y, [x1, x2], subject, time) OVER ()] |
| gls_augment_agg | aggregate | Window aggregate: fits the same GLS model as gls_fit_agg over the frame and returns one STRUCT per input row (in frame order): fitted (x'b for every row with x), se_fit, residual, pearson_residual, normalized_residual and is_training. Use it over a whole partition, as gls_augment_by does. | NULL | [gls_augment_agg(y, [x1, x2], subject, time, {'correlation': 'ar1'}) OVER ()] |
| gls_augment_agg | aggregate | Window aggregate: fits the same GLS model as gls_fit_agg over the frame and returns one STRUCT per input row (in frame order): fitted (x'b for every row with x), se_fit, residual, pearson_residual, normalized_residual and is_training. Use it over a whole partition, as gls_augment_by does. | NULL | [gls_augment_agg(y, [x1], subject, time, arm, {'correlation': 'ar1', 'variance': 'ident'}) OVER ()] |
| gls_augment_by | table_macro | Table macro: fits one GLS model (gls_augment_agg) per group_col and returns every source row with its per-observation results (the integration contract's `obs` schema): all source columns, model_id and model_name ('gls'), row_id, fitted (x'b), residual (y - fitted), resid_type ('response'), std_residual (the Pearson residual), stud_residual, leverage, cooks_d, dffits (NULL), weight, is_training, n_params (NULL), then se_fit and normalized_residual. Rows the fit could not use get NULL residuals; rows with x get fitted and se_fit. | NULL | [gls_augment_by('visits', clinic, y, [dose], patient, week, options := {'correlation': 'ar1'})] |
| gls_fit_agg | aggregate | Fits a generalized least squares model (nlme::gls): a linear model whose errors are correlated within each subject (options correlation: independent, compound_symmetry, ar1, car1, exponential, gaussian, linear, spherical, unstructured; nugget) with an optional variance function of variance_covariate (variance: ident, power, exp), estimated by REML (default) or ML (method). Returns the coefficients, sigma, the correlation and variance parameters, the log-likelihood, AIC and BIC, and with compute_inference the t tests and the var-cov intervals. | NULL | [gls_fit_agg(y, [x1, x2], subject, time)] |
| gls_fit_agg | aggregate | Fits a generalized least squares model (nlme::gls): a linear model whose errors are correlated within each subject (options correlation: independent, compound_symmetry, ar1, car1, exponential, gaussian, linear, spherical, unstructured; nugget) with an optional variance function of variance_covariate (variance: ident, power, exp), estimated by REML (default) or ML (method). Returns the coefficients, sigma, the correlation and variance parameters, the log-likelihood, AIC and BIC, and with compute_inference the t tests and the var-cov intervals. | NULL | [gls_fit_agg(y, [x1, x2], subject, time, {'correlation': 'ar1'})] |
| gls_fit_agg | aggregate | Fits a generalized least squares model (nlme::gls): a linear model whose errors are correlated within each subject (options correlation: independent, compound_symmetry, ar1, car1, exponential, gaussian, linear, spherical, unstructured; nugget) with an optional variance function of variance_covariate (variance: ident, power, exp), estimated by REML (default) or ML (method). Returns the coefficients, sigma, the correlation and variance parameters, the log-likelihood, AIC and BIC, and with compute_inference the t tests and the var-cov intervals. | NULL | [gls_fit_agg(y, [x1], subject, time, arm, {'correlation': 'ar1', 'variance': 'ident'})] |
| gls_fit_by | table_macro | Table macro: fits one generalized least squares model (gls_fit_agg, errors correlated within subject_col, ordered by time_col) per group_col and returns one row per group: the group column and every field of the gls_fit_agg STRUCT. variance_col := is the variance covariate of options.variance. | NULL | [gls_fit_by('visits', clinic, y, [dose], patient, week, options := {'correlation': 'ar1'})] |
| gls_glance_by | table_macro | Table macro: fits one GLS model (gls_fit_agg) per group_col and returns its fit statistics in long form (the integration contract's `summary` schema): the group column, id, model_id and model_name ('gls'), model_type, metric, value. Metrics: n_observations, n_groups (subjects), n_features, n_params, sigma, log_likelihood (REML or ML), aic, bic, df_residual, iterations, converged (1/0). | NULL | [gls_glance_by('visits', clinic, y, [dose], patient, week, options := {'correlation': 'ar1'})] |
| gls_tidy_by | table_macro | Table macro: fits one GLS model (gls_fit_agg) per group_col and returns its terms (the integration contract's `terms` schema): the group column, id, model_id and model_name ('gls'), term, estimate, std_error, statistic (t), p_value, conf_low, conf_high, conf_level, index_name, index_value, then effect: 'coefficient' rows (t tests on N - p df), 'correlation' rows (phi, rho, range / nugget or cor_), 'variance' rows (sd_ratio_ or delta) and the 'sigma' row, with the approximate var-cov intervals (nlme intervals()). Inference is always computed. names := [...] labels the coefficients. | NULL | [gls_tidy_by('visits', clinic, y, [dose], patient, week, options := {'correlation': 'ar1'})] |
| gvif_agg | aggregate | Generalized variance inflation factors (Fox & Monette 1992) per term, as car::vif reports them: one list element per term with term, df (number of columns), gvif and gvif_adj = GVIF^(1/(2 df)), comparable across terms of different size. Options: terms (one label per x column; equal labels form one term, e.g. the dummies of a factor). Without terms every column is its own term and gvif is the ordinary VIF. | NULL | [gvif_agg([age, region_b, region_c], {'terms': ['age', 'region', 'region']})] |
| gvif_agg | aggregate | Generalized variance inflation factors (Fox & Monette 1992) per term, as car::vif reports them: one list element per term with term, df (number of columns), gvif and gvif_adj = GVIF^(1/(2 df)), comparable across terms of different size. Options: terms (one label per x column; equal labels form one term, e.g. the dummies of a factor). Without terms every column is its own term and gvif is the ordinary VIF. | NULL | [gvif_agg([x1, x2, x3])] |
| hellinger_agg | aggregate | Hellinger distance in [0, 1] on shared bins (evidently 'hellinger'). | NULL | [hellinger_agg(value, group_id, {'binning': 'auto', 'threshold': 0.1})] |
| hellinger_agg | aggregate | Hellinger distance in [0, 1] on shared bins (evidently 'hellinger'). Default options. | NULL | [hellinger_agg(value, group_id)] |
| hoeffding_d_agg | aggregate | Hoeffding's D of x and y (Hmisc::hoeffd): a rank measure of dependence of any form, scaled by 30 (range -0.5 to 1), with its asymptotic P-value. Returns d, p_value, n and the unified test fields. Needs five or more complete rows; O(n^2). | NULL | [hoeffding_d_agg(x, y)] |
| huber_fit | scalar | Fits a Huber M-estimator regression model with optional MAP of settings (epsilon, alpha, fit_intercept, compute_inference, confidence_level, max_iterations, tolerance). | NULL | [huber_fit(y, x, {'epsilon': 1.35, 'alpha': 0.01})] |
| huber_fit | scalar | Fits a Huber M-estimator robust regression model. Returns coefficients, fit statistics, the MAD-based scale, and the outlier count as a struct. | NULL | [huber_fit(y, x)] |
| huber_fit_agg | aggregate | Fits a Huber M-estimator robust regression model and returns coefficients, fit statistics, the MAD-based scale, and the outlier count as a struct. | NULL | [huber_fit_agg(y, x)] |
| huber_fit_agg | aggregate | Fits a Huber M-estimator robust regression model and returns coefficients, fit statistics, the MAD-based scale, and the outlier count as a struct. | NULL | [huber_fit_agg(y, x, {'epsilon': 1.35, 'fit_intercept': true})] |
| huber_fit_predict | aggregate | Window aggregate: fits a Huber M-estimator regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use huber_fit_predict_agg. | NULL | [huber_fit_predict(y, x) OVER (PARTITION BY g ORDER BY t)] |
| huber_fit_predict | aggregate | Window aggregate: fits a Huber M-estimator regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use huber_fit_predict_agg. | NULL | [huber_fit_predict(y, x, {'epsilon': 1.5}) OVER (...)] |
| huber_fit_predict_agg | aggregate | Fits Huber regression on training rows with a MAP of options and predicts all rows. | NULL | [huber_fit_predict_agg(y, x, split_col, {'epsilon': 1.5})] |
| huber_fit_predict_agg | aggregate | Fits Huber regression over a partition with a MAP of options and returns per-row predictions with prediction intervals. | NULL | [huber_fit_predict_agg(y, x, {'epsilon': 1.35, 'null_policy': 'drop'})] |
| huber_fit_predict_agg | aggregate | Fits Huber regression using only training rows (split_col='train') and predicts all rows. | NULL | [huber_fit_predict_agg(y, x, split_col)] |
| huber_fit_predict_agg | aggregate | Fits a Huber M-estimator robust regression over a partition and returns per-row predictions with prediction intervals. | NULL | [huber_fit_predict_agg(y, x)] |
| huber_fit_predict_by | table_macro | Table macro: fits a Huber M-estimator regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [huber_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| huber_glance_by | table_macro | Table macro: fits a Huber M-estimator regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [huber_glance_by('my_table', group_col, y, [x1, x2])] |
| huber_prediction_by | table_macro | Table macro: fits a Huber M-estimator regression per group of source (huber_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('huber'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [huber_prediction_by('sales', store, week, revenue, [price, promo])] |
| huber_rolling_tidy_by | table_macro | Table macro: fits a Huber M-estimator regression over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [huber_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], window_size := 24)] |
| huber_tidy_by | table_macro | Table macro: fits a Huber M-estimator regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [huber_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| icc_agg | aggregate | Computes the Intraclass Correlation Coefficient (ICC) to measure rater or measurement consistency. | NULL | [icc_agg(value, subject_id, rater_id)] |
| icc_agg | aggregate | Computes the Intraclass Correlation Coefficient (ICC) to measure rater or measurement consistency. Option type: 'icc1' (default, alias 'single'), 'icc2', 'icc3', 'icc1k' (alias 'average'), 'icc2k', 'icc3k' (Shrout & Fleiss / psych::ICC). | NULL | [icc_agg(value, subject_id, rater_id, {'type': 'icc2'})] |
| isotonic_fit_agg | aggregate | Fits a monotonic (isotonic) regression of y on a single x per group and returns the step function as sorted knots x with fitted values. | NULL | [isotonic_fit_agg(y, x)] |
| isotonic_fit_agg | aggregate | Fits a monotonic (isotonic) regression of y on a single x per group and returns the step function as sorted knots x with fitted values. | NULL | [isotonic_fit_agg(y, x, {'increasing': false})] |
| isotonic_fit_predict_agg | aggregate | Fits an isotonic regression model on training rows with a MAP of options and predicts all rows. | NULL | [isotonic_fit_predict_agg(y, x, split_col, {'increasing': true})] |
| isotonic_fit_predict_agg | aggregate | Fits an isotonic regression model over a partition and returns per-row predictions. | NULL | [isotonic_fit_predict_agg(y, x)] |
| isotonic_fit_predict_agg | aggregate | Fits an isotonic regression model over a partition with a MAP of options and returns per-row predictions. | NULL | [isotonic_fit_predict_agg(y, x, {'increasing': true})] |
| isotonic_fit_predict_agg | aggregate | Fits an isotonic regression model using only training rows (split_col='train') and predicts all rows. | NULL | [isotonic_fit_predict_agg(y, x, split_col)] |
| isotonic_fit_predict_by | table_macro | Table macro: fits an isotonic regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [isotonic_fit_predict_by('my_table', group_col, y, x)] |
| isotonic_prediction_by | table_macro | Table macro: fits an isotonic regression per group of source (isotonic_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('isotonic'), x (x_col, the plot position and row order, and the model's one feature), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [isotonic_prediction_by('sales', store, price, revenue)] |
| jarque_bera | scalar | Tests whether a sample has skewness and kurtosis consistent with a normal distribution (Jarque-Bera test). | NULL | [jarque_bera(values)] |
| jarque_bera_agg | aggregate | Aggregate version of the Jarque-Bera normality test, applied to a column of values. | NULL | [jarque_bera_agg(value)] |
| jensen_shannon_agg | aggregate | Jensen-Shannon distance (square root of the divergence) on shared bins (evidently 'jensenshannon'). | NULL | [jensen_shannon_agg(value, group_id, {'binning': 'auto', 'base': 2})] |
| jensen_shannon_agg | aggregate | Jensen-Shannon distance (square root of the divergence) on shared bins (evidently 'jensenshannon'). Default options. | NULL | [jensen_shannon_agg(value, group_id)] |
| kaplan_meier_agg | aggregate | Kaplan-Meier curve with a MAP / STRUCT of options (R survfit, via anofox-regression): conf_level, conf_type, hazard ('nelson-aalen' [default] or 'fleming-harrington'), robust, timefix; with a DOUBLE[] of per-row columns, weight, entry (left truncation, Surv(entry, time, event)) and cluster name their 1-based positions. Adds cumhaz and std_chaz; the counts are DOUBLE (weighted sums). | NULL | [kaplan_meier_agg(duration, event, [entry_day, w], {'entry': 1, 'weight': 2})] |
| kaplan_meier_agg | aggregate | Kaplan-Meier survival curve (R survival::survfit) with a confidence level (DOUBLE, the original form) or a MAP / STRUCT of options (conf_level, conf_type, hazard, robust, timefix; adds cumhaz and std_chaz). | NULL | [kaplan_meier_agg(duration, event, {'hazard': 'fleming-harrington'})] |
| kaplan_meier_agg | aggregate | Kaplan-Meier survival curve of right-censored durations (event true/1 = observed, false/0 = censored), as R survival::survfit: one row per distinct time with surv, the pointwise confidence interval conf_low/conf_high (Greenwood; conf_type 'log' [default], 'log-log' or 'plain'; conf_level default 0.95), n_risk, n_event, n_censor and the Greenwood std_err of surv. | NULL | [kaplan_meier_agg(duration, event)] |
| kaplan_meier_agg | aggregate | Kaplan-Meier survival curve of right-censored durations (event true/1 = observed, false/0 = censored), as R survival::survfit: one row per distinct time with surv, the pointwise confidence interval conf_low/conf_high (Greenwood; conf_type 'log' [default], 'log-log' or 'plain'; conf_level default 0.95), n_risk, n_event, n_censor and the Greenwood std_err of surv. | NULL | [kaplan_meier_agg(duration, event, 0.95, 'log-log')] |
| kaplan_meier_by | table_macro | Table macro: one Kaplan-Meier curve per stratum of source (R survfit(Surv(time, event) ~ strata)), one row per distinct time (the integration contract's `curve` schema, curve_type 'km', series = stratum): the stratum column, model_id, series, curve_type, x (time), y (survival), y_low / y_high (pointwise interval), threshold, weight (number at risk), n_censor, then n_risk, n_event and std_err. | NULL | [kaplan_meier_by('patients', treatment, duration, event, conf_type := 'log-log')] |
| kendall_agg | aggregate | Computes Kendall's tau rank correlation coefficient and tests its significance. | NULL | [kendall_agg(x, y)] |
| kendall_agg | aggregate | Computes Kendall's tau rank correlation coefficient and tests its significance. | NULL | [kendall_agg(x, y, {'alternative': 'two_sided'})] |
| kl_divergence_agg | aggregate | Kullback-Leibler divergence KL(reference \|\| current) on shared bins (evidently 'kl_div'). | NULL | [kl_divergence_agg(value, group_id, {'binning': 'auto', 'base': 2})] |
| kl_divergence_agg | aggregate | Kullback-Leibler divergence KL(reference \|\| current) on shared bins (evidently 'kl_div'). Default options. | NULL | [kl_divergence_agg(value, group_id)] |
| kruskal_wallis_agg | aggregate | Performs the Kruskal-Wallis H-test, a nonparametric alternative to one-way ANOVA. | NULL | [kruskal_wallis_agg(value, group_id)] |
| ks_test_agg | aggregate | Two-sample Kolmogorov-Smirnov test (R ks.test): exact p-value when n1*n2 < 10000, otherwise the limiting Kolmogorov distribution. | NULL | [ks_test_agg(value, group_id, {'alternative': 'two_sided', 'exact': true})] |
| ks_test_agg | aggregate | Two-sample Kolmogorov-Smirnov test (R ks.test): exact p-value when n1*n2 < 10000, otherwise the limiting Kolmogorov distribution. Default options. | NULL | [ks_test_agg(value, group_id)] |
| lars_fit_agg | aggregate | Fits a Least Angle Regression (LARS / LassoLars) model and returns coefficients and fit statistics. | NULL | [lars_fit_agg(y, x, {'fit_intercept': true, 'alpha': 0.0})] |
| lars_fit_agg | aggregate | Fits a Least Angle Regression (LARS) model and returns coefficients and fit statistics. | NULL | [lars_fit_agg(y, x)] |
| lars_glance_by | table_macro | Table macro: fits a LARS / Lasso-LARS regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [lars_glance_by('my_table', group_col, y, [x1, x2])] |
| lars_path_agg | aggregate | LARS / Lasso-LARS coefficient path per group, one entry per knot (index_name 'alpha', index_value the knot's alpha = max_j \|x_j'(y - yhat)\| on the centred design, columns scaled to unit norm with standardize; this is n * glmnet's lambda without standardize and sqrt(n) * lambda with it). Options: method ('lasso' default, 'lar'), standardize (true), n_nonzero_coefs, fit_intercept, feature_names. | NULL | [lars_path_agg(y, [x1, x2, x3])] |
| lars_path_agg | aggregate | LARS / Lasso-LARS coefficient path per group, one entry per knot (index_name 'alpha', index_value the knot's alpha = max_j \|x_j'(y - yhat)\| on the centred design, columns scaled to unit norm with standardize; this is n * glmnet's lambda without standardize and sqrt(n) * lambda with it). Options: method ('lasso' default, 'lar'), standardize (true), n_nonzero_coefs, fit_intercept, feature_names. | NULL | [lars_path_agg(y, [x1, x2])] |
| lars_path_by | table_macro | Table macro: computes the LARS / Lasso-LARS coefficient path per group of source with lars_path_agg (same options) and returns one row per index value and term in the `terms` schema: the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('alpha'), index_value. names := [...] labels the terms. | NULL | [lars_path_by('my_table', group_col, y, [x1, x2])] |
| lars_tidy_by | table_macro | Table macro: fits a LARS / Lasso-LARS regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model has no coefficient inference. names := [...] labels the terms. | NULL | [lars_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| linear_predict | scalar | Applies coefficients and an intercept to column-layout feature data (LIST of feature columns) and returns the list of predictions. Same as the 3-argument predict(). | NULL | [linear_predict([[1.0, 2.0], [3.0, 4.0]], [0.5, 1.5], 2.0)] |
| ljung_box_agg | aggregate | Ljung-Box portmanteau test for autocorrelation of x in the aggregate's ORDER BY order (R Box.test(x, lag, type = 'Ljung-Box', fitdf)): statistic Q, df1 = lag - fitdf, p_value. lag defaults to 1, fitdf to 0. | NULL | [ljung_box_agg(resid, 10, 2 ORDER BY t)] |
| lm_dynamic_fit_agg | aggregate | Fits a dynamic linear model with time-varying coefficients (greybox lmDynamic, bruteforce): every subset of the regressors is fitted, each row weights them by its pointwise information criterion and gets the weighted coefficients. Rows are in input order (give it with ORDER BY). Returns the time-averaged coefficients and intercept, fit statistics, n_models and, per row used, dynamic_intercept, dynamic_coefficients and fitted_values. Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_agg(y, [x1, x2] ORDER BY t)] |
| lm_dynamic_fit_agg | aggregate | Fits a dynamic linear model with time-varying coefficients (greybox lmDynamic, bruteforce): every subset of the regressors is fitted, each row weights them by its pointwise information criterion and gets the weighted coefficients. Rows are in input order (give it with ORDER BY). Returns the time-averaged coefficients and intercept, fit statistics, n_models and, per row used, dynamic_intercept, dynamic_coefficients and fitted_values. Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_agg(y, [x1, x2], {'ic': 'bic', 'span': 0.5} ORDER BY t)] |
| lm_dynamic_fit_predict_agg | aggregate | Fits a dynamic linear model (greybox lmDynamic) on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (the row's own time-varying fit; rows outside the fit use the time-averaged coefficients), yhat_lower / yhat_upper (NULL), is_training, and the row's dynamic intercept and coefficients (NULL outside the fit). Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_predict_agg(y, x ORDER BY t)] |
| lm_dynamic_fit_predict_agg | aggregate | Fits a dynamic linear model (greybox lmDynamic) on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (the row's own time-varying fit; rows outside the fit use the time-averaged coefficients), yhat_lower / yhat_upper (NULL), is_training, and the row's dynamic intercept and coefficients (NULL outside the fit). Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_predict_agg(y, x, split ORDER BY t)] |
| lm_dynamic_fit_predict_agg | aggregate | Fits a dynamic linear model (greybox lmDynamic) on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (the row's own time-varying fit; rows outside the fit use the time-averaged coefficients), yhat_lower / yhat_upper (NULL), is_training, and the row's dynamic intercept and coefficients (NULL outside the fit). Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_predict_agg(y, x, split, {'ic': 'aic'} ORDER BY t)] |
| lm_dynamic_fit_predict_agg | aggregate | Fits a dynamic linear model (greybox lmDynamic) on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (the row's own time-varying fit; rows outside the fit use the time-averaged coefficients), yhat_lower / yhat_upper (NULL), is_training, and the row's dynamic intercept and coefficients (NULL outside the fit). Options: ic ('aicc' default \| 'aic' \| 'bic'), span (lowess f smoothing the model weights over time, default 0.3; 0 = no smoothing), fit_intercept. | NULL | [lm_dynamic_fit_predict_agg(y, x, {'span': 0} ORDER BY t)] |
| lm_dynamic_fit_predict_by | table_macro | Table macro: fits a dynamic linear model with time-varying coefficients (greybox lmDynamic) per group of source in order_by order (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (the row's own time-varying fit; rows outside the fit use the time-averaged coefficients), yhat_lower / yhat_upper (NULL) and is_training appended. | NULL | [lm_dynamic_fit_predict_by('my_table', group_col, y, [x1, x2], order_by := t)] |
| lm_dynamic_glance_by | table_macro | Table macro: fits a dynamic linear model with time-varying coefficients (greybox lmDynamic) per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. Rows are fitted in order_col order (the model is sequential). | NULL | [lm_dynamic_glance_by('my_table', group_col, t, y, [x1, x2])] |
| lm_dynamic_prediction_by | table_macro | Table macro: fits a dynamic linear model with time-varying coefficients (greybox lmDynamic) per group of source (lm_dynamic_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('lm_dynamic'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [lm_dynamic_prediction_by('sales', store, week, revenue, [price, promo])] |
| lm_dynamic_tidy_by | table_macro | Table macro: fits a dynamic linear model with time-varying coefficients (greybox lmDynamic) per group of source (rows in order_col order) and returns the time-varying coefficients of every fitted row as `terms` rows, intercept first (the shape of _rolling_tidy_by): the group column, id (the group), model_id and model_name (the method), window_end (the row's order_col value), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level (NULL: no inference), index_name ('window_end'), index_value (the row's 1-based position among the fitted rows). names := [...] labels the terms. | NULL | [lm_dynamic_tidy_by('my_table', group_col, t, y, [x1, x2], names := ['x1', 'x2'])] |
| log_loss_agg | aggregate | Log loss (mean binary cross-entropy, scikit-learn log_loss); probabilities are clipped to [eps, 1 - eps]. | NULL | [log_loss_agg(y_true, prob)] |
| log_rank_test_agg | aggregate | G-rho test of equal survival across groups (R survival::survdiff(rho)): option rho (0 = log-rank, 1 = Peto-Peto). | NULL | [log_rank_test_agg(duration, event, treatment, {'rho': 1})] |
| log_rank_test_agg | aggregate | G-rho test of equal survival across groups (R survival::survdiff(rho), via anofox-regression when rho != 0 or strata are given): option rho (0 = log-rank, 1 = Peto-Peto); with a DOUBLE[] of per-row columns, strata names the 1-based position of a stratum code (survdiff(... + strata(s))). | NULL | [log_rank_test_agg(duration, event, treatment, [site], {'rho': 1, 'strata': 1})] |
| log_rank_test_agg | aggregate | Log-rank test of equal survival across two or more groups (R survival::survdiff, rho = 0): statistic (chi-squared), df1 (groups - 1), p_value, n. | NULL | [log_rank_test_agg(duration, event, treatment)] |
| logistic_augment_agg | aggregate | Fits a logistic regression over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [logistic_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| logistic_augment_agg | aggregate | Fits a logistic regression over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [logistic_augment_agg(y, [x1, x2], {'fit_intercept': true}) OVER ()] |
| logistic_augment_by | table_macro | Table macro: fits a logistic regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [logistic_augment_by('my_table', group_col, y, [x1, x2])] |
| logistic_effects_by | table_macro | Table macro: marginal-effect grid of a logistic regression per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of logistic_tidy_by). | NULL | [logistic_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| logistic_fit_agg | aggregate | Fits a binary Logistic regression (binomial GLM with logit link; classifier API). y must be binary (0 or 1). Result struct extends the standard GLM shape with `accuracy` (on training data, at the configured threshold) and the `threshold` echo. Optional L2 (ridge) penalty. | NULL | [logistic_fit_agg(y, x, {'glm_lambda': 0.1, 'threshold': 0.5})] |
| logistic_fit_agg | aggregate | Fits a binary Logistic regression (binomial GLM with logit link; classifier API). y must be binary (0 or 1). Result struct extends the standard GLM shape with `accuracy` and the `threshold` echo. | NULL | [logistic_fit_agg(y, x)] |
| logistic_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [logistic_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| logistic_fit_predict_by | table_macro | Table macro: fits a logistic regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [logistic_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| logistic_glance_by | table_macro | Table macro: fits a logistic regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [logistic_glance_by('my_table', group_col, y, [x1, x2])] |
| logistic_partial_residuals_agg | aggregate | Fits a logistic regression over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [logistic_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| logistic_partial_residuals_by | table_macro | Table macro: fits a logistic regression per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [logistic_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| logistic_prediction_by | table_macro | Table macro: fits a logistic regression per group of source (logistic_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('logistic'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [logistic_prediction_by('sales', store, week, revenue, [price, promo])] |
| logistic_tidy_by | table_macro | Table macro: fits a logistic regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [logistic_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| lowess_agg | aggregate | LOWESS scatterplot smoother of y on x per group (R stats::lowess: local linear fits with tricube weights over the frac * n nearest points, iterations robustifying passes; delta at R's default). Returns the curve as a LIST of {x, yhat}, x increasing, one point per complete row. frac defaults to 2/3, iterations to 3. | NULL | [lowess_agg(y, x)] |
| lowess_agg | aggregate | LOWESS scatterplot smoother of y on x per group (R stats::lowess: local linear fits with tricube weights over the frac * n nearest points, iterations robustifying passes; delta at R's default). Returns the curve as a LIST of {x, yhat}, x increasing, one point per complete row. frac defaults to 2/3, iterations to 3. | NULL | [lowess_agg(y, x, 0.3)] |
| lowess_agg | aggregate | LOWESS scatterplot smoother of y on x per group (R stats::lowess: local linear fits with tricube weights over the frac * n nearest points, iterations robustifying passes; delta at R's default). Returns the curve as a LIST of {x, yhat}, x increasing, one point per complete row. frac defaults to 2/3, iterations to 3. | NULL | [lowess_agg(y, x, 0.3, 0)] |
| lowess_by | table_macro | Table macro: the LOWESS smoother of y_col on x_col per group of source (R stats::lowess(x, y, f = frac, iter = iterations), see lowess_agg), one row per point in x order (the integration contract's `curve` schema, curve_type 'lowess'): the group column, id (the group), model_id and model_name ('lowess'), curve_type, series, x, y (the smoothed value), y_low, y_high, threshold, weight, n_censor. | NULL | [lowess_by('measurements', sensor, temperature, load, frac := 0.3)] |
| lr_test | scalar | Likelihood-ratio test of two nested fitted models (R's anova(reduced, full, test = 'LRT') / lmtest::lrtest): the chi-square statistic, df1 = difference in estimated parameters, p_value. GLMs with an estimated dispersion (Gamma, Tweedie) divide the deviance difference by the full model's dispersion. Both models must be the same model type and family fitted on the same rows; model_full must have more parameters. | NULL | [lr_test(poisson_fit_agg(y, [x1, x2]), poisson_fit_agg(y, [x1]))] |
| lr_test | scalar | Model likelihood-ratio test of a fitted model against its null (intercept-only) model, on k - 1 degrees of freedom (the 'Model L.R.' of rms). | NULL | [lr_test(logistic_fit_agg(y, [x1, x2]))] |
| lrm_stats_agg | aggregate | The stats vector of a binary rms::lrm fit from its 0/1 response, its linear predictor lp (with intercept, at the maximum likelihood estimate) and the model d.f. df (constant): n, sum_weights, model_lr, df, p_value, c, dxy, gamma, tau_a, the Nagelkerke r2, r2_n / r2_adj_n (R2(n), R2(p,n)), the effective sample size ess with r2_ess / r2_adj_ess (R2(m), R2(p,m)), brier, the g-index g, gr = exp(g) and gp. | NULL | [lrm_stats_agg(y_true, lp, 2)] |
| ls_state_agg | aggregate | Compact, mergeable least-squares state of a group's rows (counts, weighted means and centred co-moments, O(p^2) bytes) as a BLOB. Store it, merge states with ls_state_combine_agg, and fit with ols_fit_from_state / wls_fit_from_state / ridge_fit_from_state without the rows. Rows with a NULL y, x element or weight are skipped; the bytes do not depend on the row order. | NULL | [ls_state_agg(y, [x1, x2])] |
| ls_state_agg | aggregate | Compact, mergeable least-squares state of a group's rows (counts, weighted means and centred co-moments, O(p^2) bytes) as a BLOB. Store it, merge states with ls_state_combine_agg, and fit with ols_fit_from_state / wls_fit_from_state / ridge_fit_from_state without the rows. Rows with a NULL y, x element or weight are skipped; the bytes do not depend on the row order. | NULL | [ls_state_agg(y, [x1, x2], weight)] |
| ls_state_combine_agg | aggregate | Merges least-squares states from ls_state_agg into one state, as if ls_state_agg had seen all their rows (NULL states are skipped). States must have the same number of features; the result does not depend on the order of the states. | NULL | [ls_state_combine_agg(state)] |
| ls_state_info | scalar | Row count (zero-weight rows included), feature count and whether the rows were weighted, of a least-squares state. | NULL | [ls_state_info(state)] |
| lsp | scalar | Linear spline basis of x, as rms::lsp: [x, (x - t1)+, (x - t2)+, ...]. | NULL | [lsp(x, [10.0, 20.0])] |
| mann_whitney_u_agg | aggregate | Performs the Mann-Whitney U test (Wilcoxon rank-sum) for two independent samples, using default options. | NULL | [mann_whitney_u_agg(value, group_id)] |
| mann_whitney_u_agg | aggregate | Performs the Mann-Whitney U test (Wilcoxon rank-sum) for two independent samples. | NULL | [mann_whitney_u_agg(value, group_id, {'alternative': 'two_sided'})] |
| mcnemar_agg | aggregate | Performs McNemar's test for marginal homogeneity in paired categorical data. | NULL | [mcnemar_agg(var1, var2)] |
| mcnemar_agg | aggregate | Performs McNemar's test for marginal homogeneity in paired categorical data. | NULL | [mcnemar_agg(var1, var2, {'correction': true})] |
| mediation_agg | aggregate | Causal mediation analysis (linear models, as R mediation::mediate): fits m ~ x + covariates and y ~ x + m + covariates and returns one row per effect (acme, ade, total, prop_mediated) with estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, method, n_obs and n_sims. Inference by nonparametric bootstrap (default), Sobel or quasi-Bayesian Monte Carlo. | NULL | [mediation_agg(y, m, treat)] |
| mediation_agg | aggregate | Causal mediation analysis (linear models, as R mediation::mediate): fits m ~ x + covariates and y ~ x + m + covariates and returns one row per effect (acme, ade, total, prop_mediated) with estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, method, n_obs and n_sims. Inference by nonparametric bootstrap (default), Sobel or quasi-Bayesian Monte Carlo. | NULL | [mediation_agg(y, m, treat, [age, baseline])] |
| mediation_agg | aggregate | Causal mediation analysis (linear models, as R mediation::mediate): fits m ~ x + covariates and y ~ x + m + covariates and returns one row per effect (acme, ade, total, prop_mediated) with estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, method, n_obs and n_sims. Inference by nonparametric bootstrap (default), Sobel or quasi-Bayesian Monte Carlo. | NULL | [mediation_agg(y, m, treat, [age], {'n_bootstrap': 2000, 'seed': 7})] |
| mediation_by | table_macro | Table macro: causal mediation analysis per group of source (linear models, as R mediation::mediate): fits mediator ~ treatment + covariates and outcome ~ treatment + mediator + covariates and returns one row per group and effect (acme, ade, total, prop_mediated) in the contract terms schema plus method, n_obs and n_sims. Inference by nonparametric bootstrap (default, n_bootstrap 1000, seed 42), Sobel or quasi-Bayesian Monte Carlo (options method, ci_type, n_bootstrap, seed, confidence_level, treat_value, control_value). | NULL | [mediation_by('trial', site, treat, m, y, covariates := [age, baseline])] |
| mmd_agg | aggregate | Computes the Maximum Mean Discrepancy (MMD) between two samples to test distributional similarity, using default options. | NULL | [mmd_agg(value, group_id)] |
| mmd_agg | aggregate | Computes the Maximum Mean Discrepancy (MMD) between two samples to test distributional similarity. | NULL | [mmd_agg(value, group_id, {'n_permutations': 1000})] |
| mmd_test_agg | aggregate | Multivariate maximum mean discrepancy two-sample test (Gretton et al., unbiased MMD^2) of two groups of equal-length vectors with a gaussian, laplacian, linear or polynomial kernel, with a seeded permutation p-value. The gaussian kernel's bandwidth defaults to the median heuristic (median pairwise distance of the pooled rows, as mmd_agg; 'bandwidth': 'median'); the result's bandwidth field reports the one used. | NULL | [mmd_test_agg(x, group_id, {'kernel': 'gaussian', 'bandwidth': 2.0})] |
| mmd_test_agg | aggregate | Multivariate maximum mean discrepancy two-sample test (Gretton et al., unbiased MMD^2) of two groups of equal-length vectors with a gaussian, laplacian, linear or polynomial kernel, with a seeded permutation p-value. The gaussian kernel's bandwidth defaults to the median heuristic (median pairwise distance of the pooled rows, as mmd_agg; 'bandwidth': 'median'); the result's bandwidth field reports the one used. Default options. | NULL | [mmd_test_agg(x, group_id)] |
| model_confidence_set_agg | aggregate | Hansen, Lunde and Nason's (2011) Model Confidence Set: the set of models that contains the best one with confidence 1 - alpha, with the elimination order and the MCS p-values. Bootstrap 'method': 'stationary' (default), 'moving_block' (R MCS::MCSprocedure(k = block_length)), 'circular_block' or 'iid'. | NULL | [model_confidence_set_agg([loss_a, loss_b, loss_c], {'alpha': 0.1, 'statistic': 'max', 'method': 'moving_block', 'block_length': 3} ORDER BY t)] |
| model_confidence_set_agg | aggregate | Hansen, Lunde and Nason's (2011) Model Confidence Set: the set of models that contains the best one with confidence 1 - alpha, with the elimination order and the MCS p-values. Bootstrap 'method': 'stationary' (default), 'moving_block' (R MCS::MCSprocedure(k = block_length)), 'circular_block' or 'iid'. Uses default options. | NULL | [model_confidence_set_agg([loss_a, loss_b, loss_c] ORDER BY t)] |
| mspe_adjusted_spa_agg | aggregate | MSPE-adjusted SPA test (Clark-McCracken): SPA bootstrap on Clark-West adjusted differentials of forecast errors, for a benchmark nested in each alternative. | NULL | [mspe_adjusted_spa_agg(benchmark_error, [error_a, error_b], {'n_bootstrap': 999} ORDER BY t)] |
| mspe_adjusted_spa_agg | aggregate | MSPE-adjusted SPA test (Clark-McCracken): SPA bootstrap on Clark-West adjusted differentials of forecast errors, for a benchmark nested in each alternative. Uses default options. | NULL | [mspe_adjusted_spa_agg(benchmark_error, [error_a, error_b] ORDER BY t)] |
| multinomial_fit_agg | aggregate | Fits a multinomial (softmax) logistic regression with an elastic-net penalty, the objective of scikit-learn's LogisticRegression: y is a VARCHAR or integer class label (the classes are its sorted distinct values, at least two). Returns STRUCT(classes, coefficients (one list of n_features values per class; a single row, the log-odds of the second class, for two classes), intercepts, n_classes, accuracy, log_likelihood, objective, lambda, l1_ratio, n_observations, n_features, iterations, converged, model_type, family, link). Options: C (default 1) or lambda (= 1 / C, 0: no penalty), l1_ratio (0 ridge, 1 lasso), fit_intercept, max_iterations (100), tolerance (1e-8). Rows with a NULL label, a NULL x or a NULL / non-finite feature are left out. | NULL | [multinomial_fit_agg(class_id, [sepal_length, petal_length])] |
| multinomial_fit_agg | aggregate | Fits a multinomial (softmax) logistic regression with an elastic-net penalty, the objective of scikit-learn's LogisticRegression: y is a VARCHAR or integer class label (the classes are its sorted distinct values, at least two). Returns STRUCT(classes, coefficients (one list of n_features values per class; a single row, the log-odds of the second class, for two classes), intercepts, n_classes, accuracy, log_likelihood, objective, lambda, l1_ratio, n_observations, n_features, iterations, converged, model_type, family, link). Options: C (default 1) or lambda (= 1 / C, 0: no penalty), l1_ratio (0 ridge, 1 lasso), fit_intercept, max_iterations (100), tolerance (1e-8). Rows with a NULL label, a NULL x or a NULL / non-finite feature are left out. | NULL | [multinomial_fit_agg(class_id, [sepal_length, petal_length], {'C': 1.0, 'l1_ratio': 0.5})] |
| multinomial_fit_agg | aggregate | Fits a multinomial (softmax) logistic regression with an elastic-net penalty, the objective of scikit-learn's LogisticRegression: y is a VARCHAR or integer class label (the classes are its sorted distinct values, at least two). Returns STRUCT(classes, coefficients (one list of n_features values per class; a single row, the log-odds of the second class, for two classes), intercepts, n_classes, accuracy, log_likelihood, objective, lambda, l1_ratio, n_observations, n_features, iterations, converged, model_type, family, link). Options: C (default 1) or lambda (= 1 / C, 0: no penalty), l1_ratio (0 ridge, 1 lasso), fit_intercept, max_iterations (100), tolerance (1e-8). Rows with a NULL label, a NULL x or a NULL / non-finite feature are left out. | NULL | [multinomial_fit_agg(species, [sepal_length, petal_length])] |
| multinomial_fit_agg | aggregate | Fits a multinomial (softmax) logistic regression with an elastic-net penalty, the objective of scikit-learn's LogisticRegression: y is a VARCHAR or integer class label (the classes are its sorted distinct values, at least two). Returns STRUCT(classes, coefficients (one list of n_features values per class; a single row, the log-odds of the second class, for two classes), intercepts, n_classes, accuracy, log_likelihood, objective, lambda, l1_ratio, n_observations, n_features, iterations, converged, model_type, family, link). Options: C (default 1) or lambda (= 1 / C, 0: no penalty), l1_ratio (0 ridge, 1 lasso), fit_intercept, max_iterations (100), tolerance (1e-8). Rows with a NULL label, a NULL x or a NULL / non-finite feature are left out. | NULL | [multinomial_fit_agg(species, [sepal_length, petal_length], {'C': 1.0, 'l1_ratio': 0.5})] |
| multinomial_fit_agg | aggregate | Fits the same multinomial logistic regression with non-negative sample weights (scikit-learn's sample_weight; a numeric third argument is the weight); a NULL weight leaves the row out. | NULL | [multinomial_fit_agg(class_id, [sepal_length, petal_length], w, {'C': 10})] |
| multinomial_fit_agg | aggregate | Fits the same multinomial logistic regression with non-negative sample weights (scikit-learn's sample_weight; a numeric third argument is the weight); a NULL weight leaves the row out. | NULL | [multinomial_fit_agg(species, [sepal_length, petal_length], w, {'C': 10})] |
| multinomial_fit_predict_by | table_macro | Table macro: fits a multinomial logistic regression (multinomial_fit_agg, options as there) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (the most probable class), probabilities (DOUBLE[] in the order of the model's classes) and is_training appended. | NULL | [multinomial_fit_predict_by('flowers', site, species, [sepal_length, petal_length], options := {'C': 1.0})] |
| multinomial_predict | scalar | Predicts one row from a multinomial_fit_agg model: the most probable class (the type of the model's classes), or with {'type': 'prob'} the class probabilities (DOUBLE[], in the order of the model's classes; scikit-learn's predict / predict_proba). NULL when the model or x is NULL or x holds a NULL. predict(model, x [, options]) does the same. | NULL | [multinomial_predict(model, [5.1, 1.4]), multinomial_predict(model, [5.1, 1.4], {'type': 'prob'})] |
| negbinom_augment_agg | aggregate | Fits a Negative Binomial GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [negbinom_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| negbinom_augment_agg | aggregate | Fits a Negative Binomial GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [negbinom_augment_agg(y, [x1, x2], {'theta': 2.0}) OVER ()] |
| negbinom_augment_by | table_macro | Table macro: fits a Negative Binomial GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [negbinom_augment_by('my_table', group_col, y, [x1, x2])] |
| negbinom_effects_by | table_macro | Table macro: marginal-effect grid of a negative binomial GLM per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of negbinom_tidy_by). | NULL | [negbinom_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| negbinom_fit_agg | aggregate | Fits a Negative Binomial GLM (log link, overdispersion parameter estimated jointly) and returns coefficients, deviance, AIC, dispersion (= alpha), and fit statistics. | NULL | [negbinom_fit_agg(y, x)] |
| negbinom_fit_agg | aggregate | Fits a Negative Binomial GLM (log link, overdispersion parameter estimated jointly) and returns coefficients, deviance, AIC, dispersion (= alpha), and fit statistics. | NULL | [negbinom_fit_agg(y, x, {'fit_intercept': true})] |
| negbinom_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [negbinom_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| negbinom_fit_predict_by | table_macro | Table macro: fits a negative binomial GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [negbinom_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| negbinom_glance_by | table_macro | Table macro: fits a negative binomial GLM per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [negbinom_glance_by('my_table', group_col, y, [x1, x2])] |
| negbinom_partial_residuals_agg | aggregate | Fits a Negative Binomial GLM over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [negbinom_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| negbinom_partial_residuals_by | table_macro | Table macro: fits a negative binomial GLM per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [negbinom_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| negbinom_prediction_by | table_macro | Table macro: fits a negative binomial GLM per group of source (negbinom_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('negbinom'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [negbinom_prediction_by('sales', store, week, revenue, [price, promo])] |
| negbinom_tidy_by | table_macro | Table macro: fits a negative binomial GLM per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [negbinom_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| nnls_fit_agg | aggregate | Fits a Non-Negative Least Squares (NNLS) regression with non-negativity constraints. | NULL | [nnls_fit_agg(y, x)] |
| nnls_fit_agg | aggregate | Fits a Non-Negative Least Squares (NNLS) regression with non-negativity constraints. | NULL | [nnls_fit_agg(y, x, {'tolerance': 1e-6})] |
| nnls_glance_by | table_macro | Table macro: fits a non-negative least squares regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [nnls_glance_by('my_table', group_col, y, [x1, x2])] |
| nnls_tidy_by | table_macro | Table macro: fits a non-negative least squares regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model has no coefficient inference. names := [...] labels the terms. | NULL | [nnls_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| nomogram_agg | aggregate | Nomogram of a main-effects model, as rms nomogram(fit): per predictor the tick values, their terms of the linear predictor (xbeta) and points; the points scale, the linear predictor at zero points (intercept), the total-points and linear-predictor axes and, with fun, a function axis (fun_at, fun_points). lp is the fit's linear predictor of each row. Options: maxscale (100), nint (10), fun ('none' \| 'plogis' \| 'exp'). | NULL | [nomogram_agg([age, sex], predict(m, effects_design([age, sex], terms), {'type': 'link'}), m, terms, {'fun': 'plogis'})] |
| ols_anova_agg | aggregate | Nested-model F test per group (R's anova(lm(y ~ x_reduced), lm(y ~ x_full))): does the full OLS model fit significantly better than the reduced one? Returns the F statistic, df1, df2, p_value, both RSS values and both adjusted R^2 values. x_reduced := [] is the intercept-only model; its columns must appear in x_full. | NULL | [ols_anova_agg(y, [price], [price, promo, temp])] |
| ols_anova_agg | aggregate | Nested-model F test per group (R's anova(lm(y ~ x_reduced), lm(y ~ x_full))): does the full OLS model fit significantly better than the reduced one? Returns the F statistic, df1, df2, p_value, both RSS values and both adjusted R^2 values. x_reduced := [] is the intercept-only model; its columns must appear in x_full. | NULL | [ols_anova_agg(y, [price], [price, promo, temp], {'fit_intercept': false})] |
| ols_anova_by | table_macro | Table macro: nested-model F test per group of source (R's anova(lm(y ~ x_reduced), lm(y ~ x_full)) on the same rows); returns one row per group with method 'nested F', statistic, p_value, df1, df2, both RSS values and the adjusted R^2 of both models. x_reduced := [] (the default) is the intercept-only model. | NULL | [ols_anova_by('sales', region, y, x_reduced := [price], x_full := [price, promo, temp])] |
| ols_anova_table_agg | aggregate | Per-term ANOVA table of an OLS fit per group: R's anova(lm(y ~ x)) (type I, sequential sums of squares in the column order) or car::Anova(fit, type = 2) (type II, each term adjusted for all others). Returns one list element per term: term, statistic (F), df1, df2 (residual df), p_value, sum_sq, mean_sq and the residual sum of squares. Options: type ('I' default, 'II'), terms (one label per x column; equal labels form one term, e.g. factor dummies), fit_intercept. | NULL | [ols_anova_table_agg(y, [price, promo, temp])] |
| ols_anova_table_agg | aggregate | Per-term ANOVA table of an OLS fit per group: R's anova(lm(y ~ x)) (type I, sequential sums of squares in the column order) or car::Anova(fit, type = 2) (type II, each term adjusted for all others). Returns one list element per term: term, statistic (F), df1, df2 (residual df), p_value, sum_sq, mean_sq and the residual sum of squares. Options: type ('I' default, 'II'), terms (one label per x column; equal labels form one term, e.g. factor dummies), fit_intercept. | NULL | [ols_anova_table_agg(y, [price, promo, temp], {'type': 'II', 'terms': ['price', 'promo', 'temp']})] |
| ols_anova_table_by | table_macro | Table macro: per-term ANOVA table per group of source (R's anova(lm(y ~ x)), type I sequential sums of squares in the column order, or car::Anova(fit, type = 2) with options {'type': 'II'}); returns one row per group and term with term, method, statistic (F), p_value, df1, df2 (residual df), sum_sq, mean_sq and the residual sum of squares. options terms: one label per x column, equal labels form one term (e.g. factor dummies). | NULL | [ols_anova_table_by('sales', region, y, [price, promo, temp], options := {'type': 'II'})] |
| ols_augment_agg | aggregate | Fits OLS over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training and n_params (broom augment). | NULL | [ols_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| ols_augment_agg | aggregate | Fits OLS over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training and n_params (broom augment). | NULL | [ols_augment_agg(y, [x1, x2], {'fit_intercept': true}) OVER ()] |
| ols_augment_by | table_macro | Table macro: fits an OLS regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, loo_residual and loo_fitted (exact leave-one-out: residual / (1 - leverage) and y minus it, NULL where leverage = 1). Non-training rows get the prediction as fitted and NULL diagnostics. | NULL | [ols_augment_by('my_table', group_col, y, [x1, x2])] |
| ols_effects_by | table_macro | Table macro: marginal-effect grid of an OLS regression per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of ols_tidy_by). | NULL | [ols_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| ols_fit | scalar | Fits an OLS regression model with optional MAP of settings (fit_intercept, compute_inference, confidence_level, solver, hc_type, alias_tolerance, compute_loo). | NULL | [ols_fit(y, x, {'compute_inference': true, 'confidence_level': 0.95})] |
| ols_fit | scalar | Fits an Ordinary Least Squares (OLS) regression model to the given response and feature data. | NULL | [ols_fit(y, x)] |
| ols_fit_agg | aggregate | Fits OLS with a cluster-robust (sandwich::vcovCL) coefficient covariance: std_errors, tests, the F test and vcov are clustered. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering. Options as the sibling plus 'cadjust' (default true); 'hc_type' picks vcovCL's type (default HC1, i.e. Stata's CR1); compute_inference defaults to true. | NULL | [ols_fit_agg(y, [x1, x2], firm_id, {'hc_type': 'hc1'})] |
| ols_fit_agg | aggregate | Fits an OLS regression model and returns coefficients and fit statistics as a struct. | NULL | [ols_fit_agg(y, x)] |
| ols_fit_agg | aggregate | Fits an OLS regression model and returns coefficients and fit statistics as a struct. | NULL | [ols_fit_agg(y, x, {'fit_intercept': true})] |
| ols_fit_from_state | scalar | Fits OLS from a least-squares state (ls_state_agg / ls_state_combine_agg): the same STRUCT as ols_fit_agg on the rows (coefficients, inference with compute_inference, vcov), up to floating-point summation order. A weighted state gives the WLS fit. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [ols_fit_from_state(state)] |
| ols_fit_from_state | scalar | Fits OLS from a least-squares state (ls_state_agg / ls_state_combine_agg): the same STRUCT as ols_fit_agg on the rows (coefficients, inference with compute_inference, vcov), up to floating-point summation order. A weighted state gives the WLS fit. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [ols_fit_from_state(state, {'compute_inference': true})] |
| ols_fit_predict | aggregate | Window aggregate: fits an OLS regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ols_fit_predict_agg. | NULL | [ols_fit_predict(y, x)] |
| ols_fit_predict | aggregate | Window aggregate: fits an OLS regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ols_fit_predict_agg. | NULL | [ols_fit_predict(y, x, {'null_policy': 'drop'})] |
| ols_fit_predict_agg | aggregate | Fits OLS regression on training rows with a MAP of options and predicts all rows. | NULL | [ols_fit_predict_agg(y, x, split_col, {'null_policy': 'drop'})] |
| ols_fit_predict_agg | aggregate | Fits OLS regression over a partition and returns per-row predictions with prediction intervals. | NULL | [ols_fit_predict_agg(y, x)] |
| ols_fit_predict_agg | aggregate | Fits OLS regression over a partition with a MAP of options and returns per-row predictions with prediction intervals. | NULL | [ols_fit_predict_agg(y, x, {'null_policy': 'drop'})] |
| ols_fit_predict_agg | aggregate | Fits OLS regression using only training rows (split_col='train') and predicts all rows. | NULL | [ols_fit_predict_agg(y, x, split_col)] |
| ols_fit_predict_by | table_macro | Table macro: fits an OLS regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [ols_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| ols_glance_by | table_macro | Table macro: fits an OLS regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [ols_glance_by('my_table', group_col, y, [x1, x2])] |
| ols_partial_residuals_agg | aggregate | Fits OLS over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots). Rows not used for fitting get NULL residuals. | NULL | [ols_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| ols_partial_residuals_by | table_macro | Table macro: fits an OLS regression per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (x_j and y residualised on the other columns). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [ols_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| ols_prediction_by | table_macro | Table macro: fits an OLS regression per group of source (ols_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('ols'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [ols_prediction_by('sales', store, week, revenue, [price, promo])] |
| ols_rolling_tidy_by | table_macro | Table macro: fits an OLS regression over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [ols_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], window_size := 24)] |
| ols_tidy_by | table_macro | Table macro: fits an OLS regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [ols_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| one_way_anova_agg | aggregate | Performs a one-way ANOVA F-test to compare means across multiple groups. | NULL | [one_way_anova_agg(value, group_id)] |
| ordinal_fit_agg | aggregate | Fits a cumulative link (ordinal regression) model, rms::orm / MASS::polr: P(Y >= y_{j+1} \| x) = F(alpha_j + x'beta) for the ordered levels y_1 < ... < y_k (the distinct values of y). Returns STRUCT(levels, counts, intercepts (alpha_j; polr's zeta_j = -alpha_j), intercept_std_errors, coefficients, std_errors, z_values, p_values, log_likelihood, null_log_likelihood, penalized_log_likelihood, lr_chisq, lr_df, lr_p_value, aic, po_test_statistic, po_test_df, po_test_p_value (proportional-odds score test), n_levels, n_observations, n_features, offset_column, penalty, iterations, converged, model_type, link). Options: link (logistic, probit, loglog, cloglog, cauchit), penalty, offset (1-based x column), max_iterations, tolerance, po_test. Rows with a NULL y, a NULL x or a NULL / non-finite feature are left out. | NULL | [ordinal_fit_agg(rating, [age, dose])] |
| ordinal_fit_agg | aggregate | Fits a cumulative link (ordinal regression) model, rms::orm / MASS::polr: P(Y >= y_{j+1} \| x) = F(alpha_j + x'beta) for the ordered levels y_1 < ... < y_k (the distinct values of y). Returns STRUCT(levels, counts, intercepts (alpha_j; polr's zeta_j = -alpha_j), intercept_std_errors, coefficients, std_errors, z_values, p_values, log_likelihood, null_log_likelihood, penalized_log_likelihood, lr_chisq, lr_df, lr_p_value, aic, po_test_statistic, po_test_df, po_test_p_value (proportional-odds score test), n_levels, n_observations, n_features, offset_column, penalty, iterations, converged, model_type, link). Options: link (logistic, probit, loglog, cloglog, cauchit), penalty, offset (1-based x column), max_iterations, tolerance, po_test. Rows with a NULL y, a NULL x or a NULL / non-finite feature are left out. | NULL | [ordinal_fit_agg(rating, [age, dose], {'link': 'probit'})] |
| ordinal_fit_agg | aggregate | Fits the same cumulative link model with non-negative case (frequency) weights (a numeric third argument is the weight); a NULL weight leaves the row out. | NULL | [ordinal_fit_agg(rating, [age, dose], w, {'link': 'logistic'})] |
| ordinal_fit_predict_by | table_macro | Table macro: fits a cumulative link model (ordinal_fit_agg, options as there) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (the most probable level), yhat_mean (the predicted mean), probabilities (DOUBLE[] in the order of the model's levels) and is_training appended. | NULL | [ordinal_fit_predict_by('ratings', site, rating, [age, dose], options := {'link': 'logistic'})] |
| ordinal_predict | scalar | Predicts one row from an ordinal_fit_agg or continuation_ratio_fit_agg model: the most probable level (DOUBLE; polr's predict(type = 'class')), or with {'type': 'prob'} the level probabilities (DOUBLE[] in the order of the model's levels), {'type': 'exceedance'} P(Y >= y_{j+1}) for j = 1..k-1 (DOUBLE[]) or {'type': 'mean'} the predicted mean sum_j y_j P(Y = y_j) (rms Mean.orm), or {'type': 'quantile'} (options q, level, method) the predicted quantile with confidence limits as STRUCT(yhat, yhat_lower, yhat_upper) (rms Quantile.orm). The model is rebuilt upstream from its stored parts. NULL when the model or x is NULL or x holds a NULL. predict(model, x [, options]) does the same. | NULL | [ordinal_predict(model, [52, 1.0]), ordinal_predict(model, [52, 1.0], {'type': 'prob'})] |
| p_adjust | aggregate | Window function (DuckDB 2.0+): the p-value of the row adjusted for multiple testing (R p.adjust) within its window frame, i.e. within the partition when OVER has no ORDER BY. NULL p-values stay NULL and are not counted. method: holm (default), hochberg, hommel, bonferroni, BH (alias fdr), BY, none; case-insensitive. n: number of hypotheses (default: the number of non-NULL p-values; may not be smaller). | NULL | [p_adjust(p_value, 'BH') OVER (PARTITION BY endpoint)] |
| p_adjust_agg | aggregate | Adjusts the p-values of a group for multiple testing (R p.adjust) and returns them as a list in input order (fix the order with ORDER BY inside the call). NULL p-values stay NULL and are not counted. method: holm (default), hochberg, hommel, bonferroni, BH (alias fdr), BY, none; case-insensitive. n: number of hypotheses (default: the number of non-NULL p-values; may not be smaller). | NULL | [p_adjust_agg(p_value, 'BH' ORDER BY test)] |
| p_adjust_by | table_macro | Table macro: adjusts the p-values in p_col for multiple testing within each group of group_col (R p.adjust; method holm (default), hochberg, hommel, bonferroni, BH/fdr, BY or none; n: number of hypotheses per group, default the number of non-NULL p-values); returns every source row, in source order, with p_adjusted appended. NULL p-values stay NULL and are not counted. | NULL | [p_adjust_by('results', endpoint, p_value, method := 'BH')] |
| p_adjust_list | scalar | Adjusts a list of p-values for multiple testing (R p.adjust); returns the adjusted list in the same order. NULL elements stay NULL and are not counted. method: holm (default), hochberg, hommel, bonferroni, BH (alias fdr), BY, none; case-insensitive. n: number of hypotheses (default: the number of non-NULL p-values; may not be smaller). | NULL | [p_adjust_list([0.01, 0.02, 0.04], 'BH')] |
| pacf_agg | aggregate | Sample partial autocorrelation function of x in the aggregate's ORDER BY order (R pacf): one row per lag 1..max_lag with the 95% white-noise band. max_lag defaults to R's floor(10 log10 n). | NULL | [pacf_agg(resid, 10 ORDER BY t)] |
| pacf_by | table_macro | Table macro: the sample partial autocorrelation function (R pacf) of value_col ordered by order_col within each group of source, one row per lag (the integration contract's `curve` schema, curve_type 'pacf'): the group column, model_id, series, curve_type, x (lag), y, y_low / y_high (95% white-noise band), threshold, weight, n_censor. max_lag defaults to R's floor(10 log10 n). | NULL | [pacf_by('residuals', store, resid, t, max_lag := 12)] |
| pairwise_t_test_agg | aggregate | Pairwise t-tests between all groups with multiple-comparison adjustment (R pairwise.t.test). Returns one row per pair: group1, group2, estimate (mean of group2 - group1), statistic (t), p_value, p_adj, and the confidence interval of estimate (conf_low, conf_high at conf_level) from the same SE and df: per comparison with p_adjust none, Bonferroni-adjusted otherwise (as emmeans); one-sided for a one-sided alternative. Options: p_adjust (holm [default], hochberg, hommel, bonferroni, BH/fdr, BY, none), pool_sd (default true), alternative (two_sided, less, greater; for group2 - group1), confidence_level (default 0.95). | NULL | [pairwise_t_test_agg(value, group, {'p_adjust': 'holm', 'pool_sd': true})] |
| pairwise_t_test_by | table_macro | Table macro: runs pairwise t-tests with p-value adjustment (R pairwise.t.test) between the levels of factor_col within each group of source and returns one row per pair (the integration contract's `test` schema): the group column, model_id, test_id ('-'), method, statistic, p_value, group1, group2, p_adj, df1, df2, estimate, conf_low, conf_high, conf_level, effect_size, effect_name, alternative, p_adjust_method. options are passed to pairwise_t_test_agg. | NULL | [pairwise_t_test_by('my_table', experiment, response, treatment)] |
| partial_cor_agg | aggregate | Partial correlation of x and y controlling for the controls (R ppcor::pcor.test), with its t test (df = n - 2 - n_controls). options: {'method': 'pearson' \| 'spearman'}. | NULL | [partial_cor_agg(x, y, [z1, z2])] |
| partial_cor_agg | aggregate | Partial correlation of x and y controlling for the controls (R ppcor::pcor.test), with its t test (df = n - 2 - n_controls). options: {'method': 'pearson' \| 'spearman'}. | NULL | [partial_cor_agg(x, y, [z1, z2], {'method': 'spearman'})] |
| passive_aggressive_fit_agg | aggregate | Fits a Passive-Aggressive online regression (scikit-learn PassiveAggressiveRegressor) by updating the coefficients row by row in input order, without shuffling; give the order with ORDER BY. Returns the coefficients, intercept, R^2 and the number of passes. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_agg(y, [x1, x2] ORDER BY t)] |
| passive_aggressive_fit_agg | aggregate | Fits a Passive-Aggressive online regression (scikit-learn PassiveAggressiveRegressor) by updating the coefficients row by row in input order, without shuffling; give the order with ORDER BY. Returns the coefficients, intercept, R^2 and the number of passes. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_agg(y, [x1, x2], {'c': 0.5, 'epsilon': 0.05, 'variant': 'pa2'} ORDER BY t)] |
| passive_aggressive_fit_predict | aggregate | Window aggregate: runs the Passive-Aggressive online update over the rows of the window frame in frame order and returns the prediction for the LAST row of the frame (yhat; yhat_lower / yhat_upper are NULL). Use frames ending at CURRENT ROW over a unique ordering. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict(y, [x1, x2]) OVER (ORDER BY t ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] |
| passive_aggressive_fit_predict | aggregate | Window aggregate: runs the Passive-Aggressive online update over the rows of the window frame in frame order and returns the prediction for the LAST row of the frame (yhat; yhat_lower / yhat_upper are NULL). Use frames ending at CURRENT ROW over a unique ordering. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict(y, [x1, x2], {'c': 0.5}) OVER (ORDER BY t ROWS BETWEEN 49 PRECEDING AND CURRENT ROW)] |
| passive_aggressive_fit_predict_agg | aggregate | Fits a Passive-Aggressive online regression on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (from the final coefficients), yhat_lower / yhat_upper (NULL: the model has no interval) and is_training. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict_agg(y, x ORDER BY t)] |
| passive_aggressive_fit_predict_agg | aggregate | Fits a Passive-Aggressive online regression on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (from the final coefficients), yhat_lower / yhat_upper (NULL: the model has no interval) and is_training. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict_agg(y, x, split ORDER BY t)] |
| passive_aggressive_fit_predict_agg | aggregate | Fits a Passive-Aggressive online regression on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (from the final coefficients), yhat_lower / yhat_upper (NULL: the model has no interval) and is_training. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict_agg(y, x, split, {'variant': 'pa2'} ORDER BY t)] |
| passive_aggressive_fit_predict_agg | aggregate | Fits a Passive-Aggressive online regression on the training rows of a partition (y NOT NULL and, with split_col, split 'train' / 'training' in any case) in input order and returns one STRUCT per row: y, yhat (from the final coefficients), yhat_lower / yhat_upper (NULL: the model has no interval) and is_training. Options: c (aggressiveness, default 1), epsilon (insensitive zone, 0.1), variant ('pa1' default \| 'pa2'), fit_intercept, max_iterations (passes over the rows, default 1 = online) and tolerance (early stopping of multi-pass fits). | NULL | [passive_aggressive_fit_predict_agg(y, x, {'c': 0.5} ORDER BY t)] |
| passive_aggressive_fit_predict_by | table_macro | Table macro: fits a Passive-Aggressive online regression per group of source, updating row by row in order_by order (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case), and returns every source row with yhat from the final coefficients, yhat_lower / yhat_upper (NULL: no interval) and is_training appended. | NULL | [passive_aggressive_fit_predict_by('my_table', group_col, y, [x1, x2], order_by := t)] |
| passive_aggressive_glance_by | table_macro | Table macro: fits a Passive-Aggressive online regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. Rows are fitted in order_col order (the model is sequential). | NULL | [passive_aggressive_glance_by('my_table', group_col, t, y, [x1, x2])] |
| passive_aggressive_prediction_by | table_macro | Table macro: fits a Passive-Aggressive online regression per group of source (passive_aggressive_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('passive_aggressive'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [passive_aggressive_prediction_by('sales', store, week, revenue, [price, promo])] |
| passive_aggressive_tidy_by | table_macro | Table macro: fits a Passive-Aggressive online regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Rows are fitted in order_col order (the model is sequential). The model has no coefficient inference. names := [...] labels the terms. | NULL | [passive_aggressive_tidy_by('my_table', group_col, t, y, [x1, x2], names := ['x1', 'x2'])] |
| pca_agg | aggregate | Principal component analysis of a column of feature vectors (R's prcomp(x, center = TRUE, scale. = FALSE)): returns STRUCT(sdev, proportion_of_variance, loadings (one list of n_features loadings per component), center, n_components, n_features, n_observations, scale (NULL unless scaled)). Each component's sign is fixed so its largest absolute loading is positive. Rows with a NULL or non-finite element are skipped. | NULL | [pca_agg([x1, x2, x3])] |
| pca_agg | aggregate | Principal component analysis of a column of feature vectors with options: n_components keeps the first components (default all, min(n - 1, n_features)); scale (default false) divides each centred column by its standard deviation, prcomp(scale. = TRUE), and stores the sds in the model's scale field (a constant column is then an error). | NULL | [pca_agg([x1, x2, x3], {'n_components': 2}), pca_agg([x1, x2, x3], {'scale': true})] |
| pca_by | table_macro | Table macro: principal component analysis per group of source (pca_agg over the group's rows of x_cols, options as pca_agg) and returns every source row with scores (DOUBLE[]: the row's scores on the kept components, pca_transform; NULL for rows with a NULL element) appended. | NULL | [pca_by('measurements', batch, [x1, x2, x3], options := {'n_components': 2})] |
| pca_transform | scalar | Scores of one feature vector on the components of a pca_agg model (R's predict.prcomp): the row minus the model's center (divided by its scale for a scaled model), times each component's loadings. NULL when the model or x is NULL or x holds a NULL. | NULL | [pca_transform(pca_agg([x1, x2]), [1.5, 2.0])] |
| pearson_agg | aggregate | Computes Pearson's product-moment correlation coefficient and tests its significance. | NULL | [pearson_agg(x, y)] |
| pearson_agg | aggregate | Computes Pearson's product-moment correlation coefficient and tests its significance. | NULL | [pearson_agg(x, y, {'alternative': 'two_sided'})] |
| penalized_ols_fit_agg | aggregate | rms::ols(penalty = ) per group: penalized least squares with an unpenalized intercept. Returns coefficients, intercept, std_errors, vcov (row-major, intercept first; var_penalty 'simple' default or 'sandwich'), r_squared, sigma (sqrt((SSE + penalty) / n)), lr_chisq, effective_df (total, per coefficient and per term), the penalty used, n_observations. Options: penalty (a number or a STRUCT {simple, nonlinear, interaction, nonlinear_interaction}), var_penalty. Columns map to terms with terms (one label per column; default every column its own linear term), nonlinear (BOOLEAN[], the nonlinear columns of a spline basis), interactions (MAP label -> [factor, factor]) and categorical (labels of the terms whose columns are dummies), as wald_anova. | NULL | [penalized_ols_fit_agg(y, [x1, x2])] |
| penalized_ols_fit_agg | aggregate | rms::ols(penalty = ) per group: penalized least squares with an unpenalized intercept. Returns coefficients, intercept, std_errors, vcov (row-major, intercept first; var_penalty 'simple' default or 'sandwich'), r_squared, sigma (sqrt((SSE + penalty) / n)), lr_chisq, effective_df (total, per coefficient and per term), the penalty used, n_observations. Options: penalty (a number or a STRUCT {simple, nonlinear, interaction, nonlinear_interaction}), var_penalty. Columns map to terms with terms (one label per column; default every column its own linear term), nonlinear (BOOLEAN[], the nonlinear columns of a spline basis), interactions (MAP label -> [factor, factor]) and categorical (labels of the terms whose columns are dummies), as wald_anova. | NULL | [penalized_ols_fit_agg(y, [x1, x2], {'penalty': 2.0})] |
| penalized_ols_fit_by | table_macro | Table macro: fits rms::ols(penalty = ) per group of source with penalized_ols_fit_agg (same options) and returns one row per group: the group column, then the fields of the fit STRUCT (coefficients, intercept, std_errors, vcov, r_squared, sigma, lr_chisq, effective_df, effective_df_by_term, ...). | NULL | [penalized_ols_fit_by('my_table', group_col, y, [x1, x2], options := {'penalty': 2.0})] |
| pentrace_agg | aggregate | rms::pentrace per group: fits the model at every penalty (rms's differential penalty by column type on standardised coefficients) and returns a LIST of rows (simple, nonlinear, interaction, nonlinear_interaction, df = effective d.f., lr_chisq, aic = LR - 2 df, bic = LR - df log n, aic_c = corrected AIC, is_best, n_observations). Options: penalties (DOUBLE[] or a STRUCT of lists by type, every combination with complex.more), model ('ols' default, 'logistic', 'ordinal'), link (logistic, probit, loglog, cloglog, cauchit), criterion ('aic_c' default, 'aic', 'bic'). Columns map to terms with terms (one label per column; default every column its own linear term), nonlinear (BOOLEAN[], the nonlinear columns of a spline basis), interactions (MAP label -> [factor, factor]) and categorical (labels of the terms whose columns are dummies), as wald_anova. | NULL | [pentrace_agg(y, [x1, x2], {'penalties': [0, 1, 2, 4, 8]})] |
| pentrace_by | table_macro | Table macro: rms::pentrace per group of source with pentrace_agg (same options, 'penalties' required) and returns one row per penalty: the group column, simple, nonlinear, interaction, nonlinear_interaction, df (effective d.f.), lr_chisq, aic, bic, aic_c, is_best, n_observations. | NULL | [pentrace_by('my_table', group_col, y, [x1, x2], options := {'penalties': [0, 1, 2, 4]})] |
| permutation_t_test_agg | aggregate | Performs a permutation-based two-sample t-test using resampling, using default options. | NULL | [permutation_t_test_agg(value, group_id)] |
| permutation_t_test_agg | aggregate | Performs a permutation-based two-sample t-test using resampling. | NULL | [permutation_t_test_agg(value, group_id, {'alternative': 'two_sided', 'n_permutations': 10000})] |
| phi_coefficient_agg | aggregate | Computes the phi coefficient (φ), a measure of association for 2×2 contingency tables. | NULL | [phi_coefficient_agg(row_var, col_var)] |
| pls_fit_agg | aggregate | Fits a Partial Least Squares regression per group and returns the coefficients, intercept, R^2 and number of components. | NULL | [pls_fit_agg(y, [x1, x2, x3])] |
| pls_fit_agg | aggregate | Fits a Partial Least Squares regression per group and returns the coefficients, intercept, R^2 and number of components. | NULL | [pls_fit_agg(y, [x1, x2, x3], {'n_components': 2})] |
| pls_fit_predict_agg | aggregate | Fits a Partial Least Squares model on training rows with a MAP of options and predicts all rows. | NULL | [pls_fit_predict_agg(y, x, split_col, {'n_components': 2})] |
| pls_fit_predict_agg | aggregate | Fits a Partial Least Squares model over a partition and returns per-row predictions. | NULL | [pls_fit_predict_agg(y, x)] |
| pls_fit_predict_agg | aggregate | Fits a Partial Least Squares model over a partition with a MAP of options and returns per-row predictions. | NULL | [pls_fit_predict_agg(y, x, {'n_components': 2})] |
| pls_fit_predict_agg | aggregate | Fits a Partial Least Squares model using only training rows (split_col='train') and predicts all rows. | NULL | [pls_fit_predict_agg(y, x, split_col)] |
| pls_fit_predict_by | table_macro | Table macro: fits a partial least squares (PLS) regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [pls_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| pls_glance_by | table_macro | Table macro: fits a partial least squares regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [pls_glance_by('my_table', group_col, y, [x1, x2])] |
| pls_prediction_by | table_macro | Table macro: fits a partial least squares regression per group of source (pls_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('pls'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [pls_prediction_by('sales', store, week, revenue, [price, promo])] |
| pls_tidy_by | table_macro | Table macro: fits a partial least squares regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model has no coefficient inference. names := [...] labels the terms. | NULL | [pls_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| poisson_augment_agg | aggregate | Fits a Poisson GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [poisson_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| poisson_augment_agg | aggregate | Fits a Poisson GLM over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [poisson_augment_agg(y, [x1, x2], {'poisson_link': 'log'}) OVER ()] |
| poisson_augment_by | table_macro | Table macro: fits a Poisson GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [poisson_augment_by('my_table', group_col, y, [x1, x2])] |
| poisson_effects_by | table_macro | Table macro: marginal-effect grid of a Poisson GLM per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of poisson_tidy_by). | NULL | [poisson_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| poisson_fit_agg | aggregate | Fits a Poisson regression (GLM with log link) and returns coefficients, deviance, AIC, and fit statistics. | NULL | [poisson_fit_agg(y, x)] |
| poisson_fit_agg | aggregate | Fits a Poisson regression (GLM with log link) and returns coefficients, deviance, AIC, and fit statistics. | NULL | [poisson_fit_agg(y, x, {'fit_intercept': true})] |
| poisson_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [poisson_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| poisson_fit_agg | aggregate | Fits the same model with prior (case) weights w, as R's glm(weights = w); a NULL weight drops the row. | NULL | [poisson_fit_agg(y, x, w), poisson_fit_agg(y, x, w, {'compute_inference': true})] |
| poisson_fit_predict_agg | aggregate | Fits a Poisson regression on training rows with a MAP of options and predicts all rows. | NULL | [poisson_fit_predict_agg(y, x, split_col, {'link': 'log'})] |
| poisson_fit_predict_agg | aggregate | Fits a Poisson regression over a partition and returns per-row predictions. | NULL | [poisson_fit_predict_agg(y, x)] |
| poisson_fit_predict_agg | aggregate | Fits a Poisson regression over a partition with a MAP of options and returns per-row predictions. | NULL | [poisson_fit_predict_agg(y, x, {'link': 'log'})] |
| poisson_fit_predict_agg | aggregate | Fits a Poisson regression using only training rows (split_col='train') and predicts all rows. | NULL | [poisson_fit_predict_agg(y, x, split_col)] |
| poisson_fit_predict_by | table_macro | Table macro: fits a Poisson GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [poisson_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| poisson_glance_by | table_macro | Table macro: fits a Poisson GLM per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [poisson_glance_by('my_table', group_col, y, [x1, x2])] |
| poisson_partial_residuals_agg | aggregate | Fits a Poisson GLM over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [poisson_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| poisson_partial_residuals_by | table_macro | Table macro: fits a Poisson GLM per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [poisson_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| poisson_prediction_by | table_macro | Table macro: fits a Poisson GLM per group of source (poisson_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('poisson'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [poisson_prediction_by('sales', store, week, revenue, [price, promo])] |
| poisson_rolling_tidy_by | table_macro | Table macro: fits a Poisson GLM over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [poisson_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], window_size := 24)] |
| poisson_tidy_by | table_macro | Table macro: fits a Poisson GLM per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [poisson_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| pool_rubin_agg | aggregate | Pools one fitted model STRUCT per imputed data set by Rubin's rules (mice::pool): pooled coefficients, total standard errors, t statistics, Barnard-Rubin d.f. (complete-data d.f. from the models' df_residual), p-values, confidence intervals, relative increase in variance (riv), lambda and the fraction of missing information (fmi), the intercept in intercept_*, the pooled vcov and the D1 Wald test of all slopes (mice::D1, f_statistic / f_df1 / f_df2 / f_pvalue). Reads coefficients, intercept and vcov (or std_errors) of each model; tidy() lists the pooled terms. | NULL | [pool_rubin_agg(fit)] |
| pool_rubin_agg | aggregate | pool_rubin_agg with options: confidence_level (0.95), df_complete (overrides the models' df_residual), small_sample (true; false gives Rubin's large-sample d.f.). | NULL | [pool_rubin_agg(fit, {'confidence_level': 0.9})] |
| pr_agg | aggregate | Precision-recall curve as a LIST of {threshold, recall, precision} in increasing threshold order, as scikit-learn precision_recall_curve; the final point (recall 0, precision 1) has a NULL threshold. | NULL | [pr_agg(y_true, score)] |
| pr_curve_by | table_macro | Table macro: computes the precision-recall curve (x = recall, y = precision; scikit-learn precision_recall_curve, see pr_agg) per group of source and returns one row per point in curve order (the integration contract's `curve` schema): the group column, model_id, series, curve_type ('pr'), x, y, y_low, y_high, threshold, weight, n_censor. y_true_col is BOOLEAN or 0/1. | NULL | [pr_curve_by('scored', model, label, score)] |
| predict | scalar | Applies pre-fitted coefficients and intercept to feature data to generate predictions. | NULL | [predict(x, coefficients, intercept)] |
| predict | scalar | Predicts one row from a fitted model STRUCT (as returned by any *_fit_agg or *_fit function). GLM models are mapped to the response scale through their link unless {'type': 'link'} is given; isotonic models are interpolated. | NULL | [predict(ols_fit_agg(y, [x1, x2]), [1.5, 2.0])] |
| predict | scalar | Predicts one row from a fitted model STRUCT with a MAP of options; {'type': 'link'} returns a GLM prediction on the link scale. {'se_fit': true} and/or {'interval': 'confidence' \| 'prediction', 'level': 0.95} return STRUCT(yhat, se_fit, yhat_lower, yhat_upper) from the model's covariance (OLS, WLS, Ridge and GLM fits with {'compute_inference': true}); GLM intervals are built on the link scale and transformed. | NULL | [predict(model, [x1, x2], {'type': 'link'}), predict(model, [x1, x2], {'se_fit': true, 'interval': 'prediction', 'level': 0.9})] |
| predict_grid_agg | aggregate | Partial effect of one predictor, as rms Predict(fit, term): the linear predictor over a grid (200 points between the datadist prediction limits, the levels of a categorical predictor, or option values) with the other predictors at their adjust-to values. One element per point: x, yhat, se_fit, yhat_lower, yhat_upper, critical (simultaneous bands only). Options: level, critical, values, simultaneous (bands simultaneous over the grid, Predict(conf.type = 'simultaneous')). | NULL | [predict_grid_agg([age, sex], m, terms, 'age', {'values': [30, 40, 50]})] |
| predict_grid_by | table_macro | Table macro: the partial effect of predictor term per group of source (predict_grid_agg, rms Predict) in the integration contract's `prediction` schema: the group column, id, model_id and model_name ('predict_grid'), focal (the predictor's 1-based position), x, y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (term). model and terms may be columns of source (e.g. joined per group) or constants; grid_values replaces the default grid, simultaneous gives simultaneous bands. | NULL | [predict_grid_by('patients_with_model', site, [age, sex], m, terms, 'age')] |
| prop_test_one_agg | aggregate | Tests whether an observed proportion differs from a hypothesized value (one-sample proportion test), using default options. | NULL | [prop_test_one_agg(value)] |
| prop_test_one_agg | aggregate | Tests whether an observed proportion differs from a hypothesized value (one-sample proportion test). | NULL | [prop_test_one_agg(value, {'p0': 0.5, 'alternative': 'two_sided'})] |
| prop_test_two_agg | aggregate | Tests whether two observed proportions are equal (two-sample proportion test), using default options. | NULL | [prop_test_two_agg(value, group_id)] |
| prop_test_two_agg | aggregate | Tests whether two observed proportions are equal (two-sample proportion test). | NULL | [prop_test_two_agg(value, group_id, {'alternative': 'two_sided'})] |
| psi_agg | aggregate | Population Stability Index of the current group against the reference on shared bins (evidently 'psi'); drift when psi >= threshold. | NULL | [psi_agg(value, group_id, {'binning': 'quantile', 'n_bins': 10})] |
| psi_agg | aggregate | Population Stability Index of the current group against the reference on shared bins (evidently 'psi'); drift when psi >= threshold. Default options. | NULL | [psi_agg(value, group_id)] |
| pspline_fit_agg | aggregate | Fits a P-spline smoother of y on x per group (mgcv s(x, bs = "ps"): cubic B-splines with a difference penalty, smoothing parameter by GCV unless lambda is given) and returns the smooth at the distinct x values (x increasing, fitted, se_fit: Bayesian standard error of the mean), the B-spline coefficients, lambda, edf (effective degrees of freedom), sigma2 (residual variance), r_squared, n_basis, penalty_order, n_observations, the basis knots and the Bayesian covariance of the coefficients (predict(model, [x]) evaluates the stored smoother at a new x), and mgcv's log_likelihood / aic / bic. Options: n_basis (alias k, 0 = automatic), penalty_order (default 2), lambda. Rows with a NULL or non-finite x or y are skipped. | NULL | [pspline_fit_agg(y, x)] |
| pspline_fit_agg | aggregate | Fits a P-spline smoother of y on x per group (mgcv s(x, bs = "ps"): cubic B-splines with a difference penalty, smoothing parameter by GCV unless lambda is given) and returns the smooth at the distinct x values (x increasing, fitted, se_fit: Bayesian standard error of the mean), the B-spline coefficients, lambda, edf (effective degrees of freedom), sigma2 (residual variance), r_squared, n_basis, penalty_order, n_observations, the basis knots and the Bayesian covariance of the coefficients (predict(model, [x]) evaluates the stored smoother at a new x), and mgcv's log_likelihood / aic / bic. Options: n_basis (alias k, 0 = automatic), penalty_order (default 2), lambda. Rows with a NULL or non-finite x or y are skipped. | NULL | [pspline_fit_agg(y, x, {'n_basis': 20, 'penalty_order': 2})] |
| pspline_fit_predict_agg | aggregate | Fits a P-spline smoother of y on x over a partition (training rows: y and x non-NULL and finite and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (interval 'prediction' (default), 'confidence' or 'none', at confidence_level, default 0.95) and is_training. Outside the training range the smooth is extended linearly. Options as pspline_fit_agg plus confidence_level and interval. | NULL | [pspline_fit_predict_agg(y, x)] |
| pspline_fit_predict_agg | aggregate | Fits a P-spline smoother of y on x over a partition (training rows: y and x non-NULL and finite and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (interval 'prediction' (default), 'confidence' or 'none', at confidence_level, default 0.95) and is_training. Outside the training range the smooth is extended linearly. Options as pspline_fit_agg plus confidence_level and interval. | NULL | [pspline_fit_predict_agg(y, x, split)] |
| pspline_fit_predict_agg | aggregate | Fits a P-spline smoother of y on x over a partition (training rows: y and x non-NULL and finite and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (interval 'prediction' (default), 'confidence' or 'none', at confidence_level, default 0.95) and is_training. Outside the training range the smooth is extended linearly. Options as pspline_fit_agg plus confidence_level and interval. | NULL | [pspline_fit_predict_agg(y, x, split, {'n_basis': 20})] |
| pspline_fit_predict_agg | aggregate | Fits a P-spline smoother of y on x over a partition (training rows: y and x non-NULL and finite and, with split_col, split 'train' / 'training' in any case) and returns one STRUCT per row: y, yhat, yhat_lower / yhat_upper (interval 'prediction' (default), 'confidence' or 'none', at confidence_level, default 0.95) and is_training. Outside the training range the smooth is extended linearly. Options as pspline_fit_agg plus confidence_level and interval. | NULL | [pspline_fit_predict_agg(y, x, {'interval': 'confidence'})] |
| pspline_fit_predict_by | table_macro | Table macro: fits a P-spline smoother (mgcv s(x, bs = 'ps')) of y_col on the single column x_col per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat, yhat_lower / yhat_upper (prediction interval at confidence_level, default 0.95; options interval 'confidence' or 'none') and is_training appended. Options as pspline_fit_predict_agg. | NULL | [pspline_fit_predict_by('my_table', group_col, y, x)] |
| pspline_prediction_by | table_macro | Table macro: fits a P-spline smoother per group of source (pspline_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('pspline'), x (x_col, the plot position and row order, and the model's one feature), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [pspline_prediction_by('sales', store, price, revenue)] |
| ptukey | scalar | Distribution function of the studentized range statistic (R ptukey(q, nmeans, df, nranges = 1, lower.tail = TRUE)). | NULL | [ptukey(3.5, 3, 12)] |
| qtukey | scalar | Quantile function of the studentized range statistic (R qtukey(p, nmeans, df, nranges = 1, lower.tail = TRUE)). | NULL | [qtukey(0.95, 3, 12)] |
| quantile_fit_agg | aggregate | Fits a linear quantile regression per group and returns the coefficients and intercept for the requested quantile tau. With {'compute_inference': true} or {'se': 'iid' \| 'nid' \| 'boot'} it adds standard errors, t statistics, p-values and conf_low / conf_high (quantreg::summary.rq). | NULL | [quantile_fit_agg(y, [x1, x2])] |
| quantile_fit_agg | aggregate | Fits a linear quantile regression per group and returns the coefficients and intercept for the requested quantile tau. With {'compute_inference': true} or {'se': 'iid' \| 'nid' \| 'boot'} it adds standard errors, t statistics, p-values and conf_low / conf_high (quantreg::summary.rq). | NULL | [quantile_fit_agg(y, [x1, x2], {'tau': 0.9, 'se': 'nid'})] |
| quantile_fit_predict_agg | aggregate | Fits a quantile regression model on training rows with a MAP of options and predicts all rows. | NULL | [quantile_fit_predict_agg(y, x, split_col, {'quantile': 0.5})] |
| quantile_fit_predict_agg | aggregate | Fits a quantile regression model over a partition and returns per-row predictions. | NULL | [quantile_fit_predict_agg(y, x)] |
| quantile_fit_predict_agg | aggregate | Fits a quantile regression model over a partition with a MAP of options and returns per-row predictions. | NULL | [quantile_fit_predict_agg(y, x, {'quantile': 0.5})] |
| quantile_fit_predict_agg | aggregate | Fits a quantile regression model using only training rows (split_col='train') and predicts all rows. | NULL | [quantile_fit_predict_agg(y, x, split_col)] |
| quantile_fit_predict_by | table_macro | Table macro: fits a quantile regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [quantile_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| quantile_glance_by | table_macro | Table macro: fits a quantile regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [quantile_glance_by('my_table', group_col, y, [x1, x2])] |
| quantile_prediction_by | table_macro | Table macro: fits a quantile regression per group of source (quantile_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('quantile'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [quantile_prediction_by('sales', store, week, revenue, [price, promo])] |
| quantile_process_agg | aggregate | Regression-quantile process per group: a quantile regression at each of taus (default 0.1, ..., 0.9) with standard errors as quantreg::summary.rq (se 'nid' default, 'iid', 'boot'; 'compute_inference': false for estimates only). Returns a LIST of `terms` rows with index_name = 'tau', index_value = tau. | NULL | [quantile_process_agg(y, [x1, x2])] |
| quantile_process_agg | aggregate | Regression-quantile process per group: a quantile regression at each of taus (default 0.1, ..., 0.9) with standard errors as quantreg::summary.rq (se 'nid' default, 'iid', 'boot'; 'compute_inference': false for estimates only). Returns a LIST of `terms` rows with index_name = 'tau', index_value = tau. | NULL | [quantile_process_agg(y, [x1, x2], {'taus': [0.25, 0.5, 0.75], 'se': 'iid'})] |
| quantile_process_by | table_macro | Table macro: computes the regression-quantile process (one quantile regression per tau, with inference) per group of source with quantile_process_agg (same options) and returns one row per index value and term in the `terms` schema: the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('tau'), index_value. names := [...] labels the terms. | NULL | [quantile_process_by('my_table', group_col, y, [x1, x2])] |
| quantile_tidy_by | table_macro | Table macro: fits a quantile regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [quantile_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| r2_measures | scalar | Explained-variation measures of Hmisc::R2Measures (RMS 2nd ed. 4.5) from a model likelihood-ratio chi-square lr on p d.f. with n observations: r2 = 1 - exp(-lr/n) (Maddala / Cox-Snell), r2_adj = 1 - exp(-max(lr - p, 0)/n), and the same two with the effective sample size ess (NULL without ess). | NULL | [r2_measures(32.8, 2, 40)] |
| r2_measures | scalar | Explained-variation measures of Hmisc::R2Measures (RMS 2nd ed. 4.5) from a model likelihood-ratio chi-square lr on p d.f. with n observations: r2 = 1 - exp(-lr/n) (Maddala / Cox-Snell), r2_adj = 1 - exp(-max(lr - p, 0)/n), and the same two with the effective sample size ess (NULL without ess). | NULL | [r2_measures(32.8, 2, 40, 28.1)] |
| ransac_fit | scalar | Fits a RANSAC regression model with optional MAP of settings (residual_threshold, max_trials, min_samples, stop_probability, stop_n_inliers, random_state, fit_intercept, compute_inference, confidence_level). | NULL | [ransac_fit(y, x, {'residual_threshold': 0.5, 'random_state': 42})] |
| ransac_fit | scalar | Fits a RANSAC robust regression model. Returns coefficients, fit statistics, the residual threshold used, and the inlier / trial counts as a struct. | NULL | [ransac_fit(y, x)] |
| ransac_fit_agg | aggregate | Fits a RANSAC robust regression model and returns coefficients, fit statistics, the residual threshold used, and the inlier / trial counts as a struct. | NULL | [ransac_fit_agg(y, x)] |
| ransac_fit_agg | aggregate | Fits a RANSAC robust regression model and returns coefficients, fit statistics, the residual threshold used, and the inlier / trial counts as a struct. | NULL | [ransac_fit_agg(y, x, {'residual_threshold': 0.5, 'random_state': 42})] |
| ransac_fit_predict | aggregate | Window aggregate: fits a RANSAC regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ransac_fit_predict_agg. | NULL | [ransac_fit_predict(y, x) OVER (PARTITION BY g ORDER BY t)] |
| ransac_fit_predict | aggregate | Window aggregate: fits a RANSAC regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ransac_fit_predict_agg. | NULL | [ransac_fit_predict(y, x, {'residual_threshold': 0.5}) OVER (...)] |
| ransac_fit_predict_agg | aggregate | Fits RANSAC on training rows with a MAP of options and predicts all rows. | NULL | [ransac_fit_predict_agg(y, x, split_col, {'residual_threshold': 0.5})] |
| ransac_fit_predict_agg | aggregate | Fits RANSAC over a partition with a MAP of options and returns per-row predictions. | NULL | [ransac_fit_predict_agg(y, x, {'residual_threshold': 0.5, 'random_state': 42})] |
| ransac_fit_predict_agg | aggregate | Fits RANSAC using only training rows (split_col='train') and predicts all rows. | NULL | [ransac_fit_predict_agg(y, x, split_col)] |
| ransac_fit_predict_agg | aggregate | Fits a RANSAC robust regression over a partition and returns per-row predictions with prediction intervals. | NULL | [ransac_fit_predict_agg(y, x)] |
| ransac_fit_predict_by | table_macro | Table macro: fits a RANSAC robust regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [ransac_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| ransac_glance_by | table_macro | Table macro: fits a RANSAC regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [ransac_glance_by('my_table', group_col, y, [x1, x2])] |
| ransac_prediction_by | table_macro | Table macro: fits a RANSAC regression per group of source (ransac_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('ransac'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [ransac_prediction_by('sales', store, week, revenue, [price, promo])] |
| ransac_tidy_by | table_macro | Table macro: fits a RANSAC regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [ransac_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| rcorr_cens_agg | aggregate | Harrell's C index of the prediction x (larger x = longer survival) for right-censored times (event true / non-zero = observed), as Hmisc::rcorr.cens: c, dxy, its standard deviation sd, n, missing, uncensored and the relevant / concordant / uncertain ordered pair counts. Pass the negated risk score to rank a hazard. | NULL | [rcorr_cens_agg(time, event, predicted_time)] |
| rcs | scalar | Restricted cubic spline basis of x with the given knots, as rms::rcs / Hmisc::rcspline.eval(x, knots, inclx = TRUE): [x, x', x'', ...] (k - 1 columns, linear beyond the outer knots). options: norm 0 \| 1 \| 2 (default 2, the terms on the scale of x). | NULL | [rcs(x, [10.0, 20.0, 30.0, 40.0])] |
| rcs | scalar | Restricted cubic spline basis of x with the given knots, as rms::rcs / Hmisc::rcspline.eval(x, knots, inclx = TRUE): [x, x', x'', ...] (k - 1 columns, linear beyond the outer knots). options: norm 0 \| 1 \| 2 (default 2, the terms on the scale of x). | NULL | [rcs(x, [10.0, 20.0, 30.0], {'norm': 0})] |
| rcs_knots_agg | aggregate | Default knots of a restricted cubic spline with nk knots (default 5) placed on x, as rms::rcs / Hmisc::rcspline.eval(x, nk, knots.only = TRUE): the RMS Table 2.3 quantiles, outer knots at the 5th smallest / largest value when n < 100. options: fractied (default 0.05). | NULL | [rcs_knots_agg(x)] |
| rcs_knots_agg | aggregate | Default knots of a restricted cubic spline with nk knots (default 5) placed on x, as rms::rcs / Hmisc::rcspline.eval(x, nk, knots.only = TRUE): the RMS Table 2.3 quantiles, outer knots at the 5th smallest / largest value when n < 100. options: fractied (default 0.05). | NULL | [rcs_knots_agg(x, 4)] |
| rcs_knots_agg | aggregate | Default knots of a restricted cubic spline with nk knots (default 5) placed on x, as rms::rcs / Hmisc::rcspline.eval(x, nk, knots.only = TRUE): the RMS Table 2.3 quantiles, outer knots at the 5th smallest / largest value when n < 100. options: fractied (default 0.05). | NULL | [rcs_knots_agg(x, 4, {'fractied': 0.1})] |
| redun_agg | aggregate | Redundancy analysis (Hmisc::redun): repeatedly predicts every feature from the others (restricted cubic splines with 3 knots) and removes the best predicted one while its R^2 exceeds 0.9. Returns variables, kept, removed, r_squared, r_squared_later, r_squared_first, too_few and n_observations. Rows with a NULL or non-finite element are skipped. | NULL | [redun_agg([x1, x2, x3])] |
| redun_agg | aggregate | Redundancy analysis with options: r2 (0.9), type (ordinary, adjusted), nk (3; 0 linear), tlinear (true), rank, qrank, allcat, types (one of spline, linear, categorical per feature), feature_names. | NULL | [redun_agg([x1, x2, x3], {'r2': 0.8})] |
| repeated_measures_anova_agg | aggregate | One-way repeated-measures ANOVA of y over the conditions measured on every subject (long format, one row per subject and condition): the within-subjects F test (R's aov(y ~ condition + Error(subject / condition))), Mauchly's sphericity test and the Greenhouse-Geisser corrected p-value (three or more conditions). Subjects missing a condition are excluded (n_excluded_subjects). Options: sphericity (default true). | NULL | [repeated_measures_anova_agg(score, patient_id, visit), repeated_measures_anova_agg(score, patient_id, visit, {'sphericity': false})] |
| residuals_diagnostics | scalar | Computes raw residuals from actuals and predictions. Standardized and studentized residuals, leverage and Cook's distance need the feature matrix: use residuals_diagnostics(y, y_hat, x, residual_std_error, include_studentized). | NULL | [residuals_diagnostics(y, y_hat)] |
| residuals_diagnostics | scalar | Computes raw, standardized and studentized residuals, leverage and Cook's distance from actuals, predictions and the feature matrix (residual_std_error may be NULL to estimate it from the residuals). | NULL | [residuals_diagnostics(y, y_hat, x, rse, true)] |
| residuals_diagnostics_agg | aggregate | Aggregate version of residuals diagnostics with feature matrix: computes raw, standardized, studentized residuals, leverage and Cook's distance from predicted and actual values and the feature matrix. | NULL | [residuals_diagnostics_agg(y, y_hat, x)] |
| residuals_diagnostics_agg | aggregate | Aggregate version of residuals diagnostics: computes raw residuals from predicted and actual values. Standardized and studentized residuals, leverage and Cook's distance need the feature matrix: use residuals_diagnostics_agg(y, y_hat, x). | NULL | [residuals_diagnostics_agg(y, y_hat)] |
| restricted_interaction | scalar | Restricted interaction of two basis rows, as rms %ia%: the products a_i * b_j without the doubly nonlinear ones. Without flags the first element of each basis is linear and the others nonlinear (rcs / lsp); pass spline_spec(...).nonlinear for other bases. | NULL | [restricted_interaction(a, b, [false, true], [true, true, true])] |
| restricted_interaction | scalar | Restricted interaction of two basis rows, as rms %ia%: the products a_i * b_j without the doubly nonlinear ones. Without flags the first element of each basis is linear and the others nonlinear (rcs / lsp); pass spline_spec(...).nonlinear for other bases. | NULL | [restricted_interaction(rcs(x1, [1.0, 2.0, 3.0, 4.0]), rcs(x2, [1.0, 2.0, 3.0]))] |
| ridge_augment_agg | aggregate | Fits Ridge over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, leverage (diagonal of the ridge hat matrix, intercept unpenalised), loo_residual and loo_fitted (exact leave-one-out at the same penalty), weight, is_training and n_params; std_residual, stud_residual, cooks_d and dffits are NULL. | NULL | [ridge_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| ridge_augment_agg | aggregate | Fits Ridge over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, leverage (diagonal of the ridge hat matrix, intercept unpenalised), loo_residual and loo_fitted (exact leave-one-out at the same penalty), weight, is_training and n_params; std_residual, stud_residual, cooks_d and dffits are NULL. | NULL | [ridge_augment_agg(y, [x1, x2], {'alpha': 1.0}) OVER ()] |
| ridge_augment_by | table_macro | Table macro: fits a Ridge regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the contract obs columns: model_id and model_name, row_id, fitted, residual, resid_type, leverage (diagonal of the ridge hat matrix X(X'X + lambda I)^-1 X', intercept unpenalised), weight, is_training, n_params, loo_residual and loo_fitted (exact leave-one-out at the same penalty: residual / (1 - leverage) and y minus it). std_residual, stud_residual, cooks_d and dffits are NULL. Non-training rows get the prediction as fitted and NULL diagnostics. | NULL | [ridge_augment_by('my_table', group_col, y, [x1, x2], {'alpha': 1.0})] |
| ridge_cv_agg | aggregate | k-fold cross-validation of the ridge path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). | NULL | [ridge_cv_agg(y, [x1, x2])] |
| ridge_cv_agg | aggregate | k-fold cross-validation of the ridge path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). | NULL | [ridge_cv_agg(y, [x1, x2], {'folds': 5, 'seed': 1})] |
| ridge_cv_agg | aggregate | k-fold cross-validation of the ridge path per group. Returns a LIST of `curve` rows (curve_type = 'lambda_cv', x = lambda, y = cv_mean, y_low / y_high = cv_mean -/+ cv_se, threshold NULL, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds), as cv.glmnet (type.measure = 'mse', or 'mae' with metric). Options: as the path, plus folds (10) and seed for the seeded folds, repeats, cv_strategy and its options (see the cv_key form). With cv_key, the folds follow cv_strategy: 'fold_id' (default; cv_key is each row's fold, any labels, at least 3), 'group' (cv_key is a group that never spans two folds; a STRUCT of several columns for a combined key), 'logo' (leave one group out), 'stratified' (cv_key is the stratum) or 'time_series' (cv_key is the time: rolling-origin splits with test_size, gap, window, max_train_size). | NULL | [ridge_cv_agg(y, [x1, x2], store, {'cv_strategy': 'group', 'folds': 5})] |
| ridge_cv_by | table_macro | Table macro: computes the k-fold cross-validation curve of the ridge path (cv.glmnet) per group of source with ridge_cv_agg (same options) and returns one row per lambda in the integration contract's `curve` schema: the group column, id (the group), model_id and model_name (the method), curve_type ('lambda_cv'), series, x (lambda), y (cv_mean), y_low, y_high (cv_mean -/+ cv_se), threshold, weight, n_censor, lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds. cv_key := column (or a STRUCT of columns) passes the cv_key of the cv_strategy option. | NULL | [ridge_cv_by('my_table', group_col, y, [x1, x2])] |
| ridge_effects_by | table_macro | Table macro: marginal-effect grid of a Ridge regression per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of ridge_tidy_by). | NULL | [ridge_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| ridge_fit | scalar | Fits a Ridge regression model with L2 regularization and optional MAP of settings (fit_intercept, compute_inference, confidence_level, alpha, solver, lambda_scaling, compute_loo). | NULL | [ridge_fit(y, x, {'alpha': 1.0, 'compute_inference': true})] |
| ridge_fit | scalar | Fits a Ridge regression model with L2 regularization to the given response and feature data. | NULL | [ridge_fit(y, x)] |
| ridge_fit_agg | aggregate | Fits a Ridge regression model with L2 regularization and returns coefficients and fit statistics. | NULL | [ridge_fit_agg(y, x)] |
| ridge_fit_agg | aggregate | Fits a Ridge regression model with L2 regularization and returns coefficients and fit statistics. Options: alpha (or lambda), fit_intercept, compute_inference, confidence_level, solver, lambda_scaling, compute_loo (exact leave-one-out press, press_rmse, loo_r_squared). | NULL | [ridge_fit_agg(y, x, {'alpha': 1.0})] |
| ridge_fit_from_state | scalar | Fits ridge regression from a least-squares state: the same STRUCT as ridge_fit_agg on the rows. The penalty (alpha, lambda_scaling) is applied here, so one stored state serves any alpha. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [ridge_fit_from_state(state, {'alpha': 0.5})] |
| ridge_fit_from_state | scalar | Fits ridge regression from a least-squares state: the same STRUCT as ridge_fit_agg on the rows. The penalty (alpha, lambda_scaling) is applied here, so one stored state serves any alpha. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [ridge_fit_from_state(state, {'alpha': 1.0})] |
| ridge_fit_predict | aggregate | Window aggregate: fits a Ridge regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ridge_fit_predict_agg. | NULL | [ridge_fit_predict(y, x)] |
| ridge_fit_predict | aggregate | Window aggregate: fits a Ridge regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use ridge_fit_predict_agg. | NULL | [ridge_fit_predict(y, x, {'null_policy': 'drop'})] |
| ridge_fit_predict_agg | aggregate | Fits Ridge regression on training rows with a MAP of options and predicts all rows. | NULL | [ridge_fit_predict_agg(y, x, split_col, {'null_policy': 'drop'})] |
| ridge_fit_predict_agg | aggregate | Fits Ridge regression over a partition and returns per-row predictions with prediction intervals. | NULL | [ridge_fit_predict_agg(y, x)] |
| ridge_fit_predict_agg | aggregate | Fits Ridge regression over a partition with a MAP of options and returns per-row predictions with prediction intervals. | NULL | [ridge_fit_predict_agg(y, x, {'null_policy': 'drop'})] |
| ridge_fit_predict_agg | aggregate | Fits Ridge regression using only training rows (split_col='train') and predicts all rows. | NULL | [ridge_fit_predict_agg(y, x, split_col)] |
| ridge_fit_predict_by | table_macro | Table macro: fits a Ridge regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [ridge_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| ridge_glance_by | table_macro | Table macro: fits a Ridge regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [ridge_glance_by('my_table', group_col, y, [x1, x2])] |
| ridge_nested_cv_agg | aggregate | Nested cross-validation of the ridge path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). | NULL | [ridge_nested_cv_agg(y, [x1, x2])] |
| ridge_nested_cv_agg | aggregate | Nested cross-validation of the ridge path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). | NULL | [ridge_nested_cv_agg(y, [x1, x2], {'folds': 5, 'inner_folds': 5})] |
| ridge_nested_cv_agg | aggregate | Nested cross-validation of the ridge path per group. Each outer fold's training rows choose lambda by an inner CV (inner_folds folds built from those rows only, respecting the same cv_key; rule 'min' or '1se') and the refit at that lambda is scored on the outer test rows. Returns a LIST of `curve` rows (curve_type = 'nested_cv'): one per outer fold (series 'fold', x = fold, y = test_error, with lambda, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds) and a summary row (series 'mean', y = the mean outer error weighted by test rows, y_low / y_high = mean -/+ test_se). Options: as the CV aggregate (cv_strategy, folds = outer folds, default 5; seed; metric) plus inner_folds (5) and rule ('min'). With cv_key, the folds follow cv_strategy: 'fold_id' (default; cv_key is each row's fold, any labels, at least 3), 'group' (cv_key is a group that never spans two folds; a STRUCT of several columns for a combined key), 'logo' (leave one group out), 'stratified' (cv_key is the stratum) or 'time_series' (cv_key is the time: rolling-origin splits with test_size, gap, window, max_train_size). | NULL | [ridge_nested_cv_agg(y, [x1, x2], store, {'cv_strategy': 'group', 'folds': 5})] |
| ridge_nested_cv_by | table_macro | Table macro: computes the nested cross-validation of the ridge path per group of source with ridge_nested_cv_agg (same options) and returns one row per outer fold plus a summary row in the integration contract's `curve` schema: the group column, id (the group), model_id and model_name (the method), curve_type ('nested_cv'), series ('fold' \| 'mean'), x (fold), y (test error), y_low, y_high (mean -/+ se on the summary row), threshold, weight, n_censor, fold, lambda, test_error, test_se, inner_cv_mean, inner_cv_se, n_train, n_test, n_inner_folds, n_folds, metric. cv_key := column (or a STRUCT of columns) passes the cv_key. | NULL | [ridge_nested_cv_by('my_table', group_col, y, [x1, x2])] |
| ridge_path_agg | aggregate | Ridge coefficient path per group, as glmnet(alpha = 0): lambda is glmnet's per-observation penalty (1/(2n) RSS + lambda/2 \|\|b\|\|^2 with y scaled to unit variance internally). Returns a LIST of `terms` rows (term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name = 'lambda', index_value = lambda), one per lambda and term, intercept first. Options: lambdas (default glmnet's grid), n_lambda (100), lambda_min_ratio, standardize (false), fit_intercept, feature_names. | NULL | [ridge_path_agg(y, [x1, x2])] |
| ridge_path_agg | aggregate | Ridge coefficient path per group, as glmnet(alpha = 0): lambda is glmnet's per-observation penalty (1/(2n) RSS + lambda/2 \|\|b\|\|^2 with y scaled to unit variance internally). Returns a LIST of `terms` rows (term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name = 'lambda', index_value = lambda), one per lambda and term, intercept first. Options: lambdas (default glmnet's grid), n_lambda (100), lambda_min_ratio, standardize (false), fit_intercept, feature_names. | NULL | [ridge_path_agg(y, [x1, x2], {'n_lambda': 20})] |
| ridge_path_by | table_macro | Table macro: computes the ridge coefficient path (glmnet alpha = 0) per group of source with ridge_path_agg (same options) and returns one row per index value and term in the `terms` schema: the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('lambda'), index_value. names := [...] labels the terms. | NULL | [ridge_path_by('my_table', group_col, y, [x1, x2])] |
| ridge_prediction_by | table_macro | Table macro: fits a Ridge regression per group of source (ridge_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('ridge'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [ridge_prediction_by('sales', store, week, revenue, [price, promo])] |
| ridge_rolling_tidy_by | table_macro | Table macro: fits a Ridge regression over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [ridge_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], window_size := 24)] |
| ridge_tidy_by | table_macro | Table macro: fits a Ridge regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [ridge_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| rls_fit | scalar | Fits a Recursive Least Squares (RLS) model to the given response and feature data. | NULL | [rls_fit(y, x)] |
| rls_fit | scalar | Fits a Recursive Least Squares (RLS) model with optional MAP of settings (fit_intercept, forgetting_factor, initial_p_diagonal). | NULL | [rls_fit(y, x, {'forgetting_factor': 0.99})] |
| rls_fit_agg | aggregate | Fits a Recursive Least Squares model and returns coefficients and fit statistics. | NULL | [rls_fit_agg(y, x)] |
| rls_fit_agg | aggregate | Fits a Recursive Least Squares model and returns coefficients and fit statistics. | NULL | [rls_fit_agg(y, x, {'forgetting_factor': 0.99})] |
| rls_fit_predict | aggregate | Window aggregate: fits a Recursive Least Squares (RLS) regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use rls_fit_predict_agg. | NULL | [rls_fit_predict(y, x)] |
| rls_fit_predict | aggregate | Window aggregate: fits a Recursive Least Squares (RLS) regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use rls_fit_predict_agg. | NULL | [rls_fit_predict(y, x, {'null_policy': 'drop'})] |
| rls_fit_predict_agg | aggregate | Fits Robust LS regression on training rows with a MAP of options and predicts all rows. | NULL | [rls_fit_predict_agg(y, x, split_col, {'null_policy': 'drop'})] |
| rls_fit_predict_agg | aggregate | Fits Robust LS regression over a partition and returns per-row predictions. | NULL | [rls_fit_predict_agg(y, x)] |
| rls_fit_predict_agg | aggregate | Fits Robust LS regression over a partition with a MAP of options and returns per-row predictions. | NULL | [rls_fit_predict_agg(y, x, {'null_policy': 'drop'})] |
| rls_fit_predict_agg | aggregate | Fits Robust LS regression using only training rows (split_col='train') and predicts all rows. | NULL | [rls_fit_predict_agg(y, x, split_col)] |
| rls_fit_predict_by | table_macro | Table macro: fits a Recursive Least Squares (RLS) regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [rls_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| rls_glance_by | table_macro | Table macro: fits a recursive least squares regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. The model is sequential: order_by := fits the rows in that order (without it the row order, and so the fit, is undefined). | NULL | [rls_glance_by('my_table', group_col, y, [x1, x2], order_by := t)] |
| rls_prediction_by | table_macro | Table macro: fits a recursive least squares regression per group of source (rls_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('rls'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [rls_prediction_by('sales', store, week, revenue, [price, promo])] |
| rls_tidy_by | table_macro | Table macro: fits a recursive least squares regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. The model is sequential: order_by := fits the rows in that order (without it the row order, and so the fit, is undefined). The model has no coefficient inference. names := [...] labels the terms. | NULL | [rls_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'], order_by := t)] |
| roc_agg | aggregate | ROC curve of a binary classifier as a LIST of {threshold, fpr, tpr}, as scikit-learn roc_curve: the first point is (0, 0) at threshold +inf, tied scores form one point, and drop_intermediate (default true) drops collinear points. y_true is BOOLEAN or 0/1. | NULL | [roc_agg(y_true, score)] |
| roc_curve_by | table_macro | Table macro: computes the ROC curve (x = false positive rate, y = true positive rate; scikit-learn roc_curve, see roc_agg) per group of source and returns one row per point in curve order (the integration contract's `curve` schema): the group column, model_id, series, curve_type ('roc'), x, y, y_low, y_high, threshold, weight, n_censor. y_true_col is BOOLEAN or 0/1. | NULL | [roc_curve_by('scored', model, label, score)] |
| semi_partial_cor_agg | aggregate | Semi-partial (part) correlation of x and y with the controls removed from y only (R ppcor::spcor.test), with its t test. Several controls are removed jointly. options: {'method': 'pearson' \| 'spearman'}. | NULL | [semi_partial_cor_agg(x, y, [z])] |
| semi_partial_cor_agg | aggregate | Semi-partial (part) correlation of x and y with the controls removed from y only (R ppcor::spcor.test), with its t test. Several controls are removed jointly. options: {'method': 'pearson' \| 'spearman'}. | NULL | [semi_partial_cor_agg(x, y, [z], {'method': 'spearman'})] |
| separation_check_agg | aggregate | Per-predictor check for complete / quasi-separation of a binary (0/1) response, which makes logistic coefficients diverge. Use detect_separation_agg for separation by a combination of predictors. | NULL | [separation_check_agg(y, [x1, x2])] |
| shapiro_wilk_agg | aggregate | Performs the Shapiro-Wilk test for normality on a sample. | NULL | [shapiro_wilk_agg(value)] |
| somers2_agg | aggregate | ROC area c and Somers' dxy = 2(c - 1/2) of a prediction for a 0/1 response, with n (the sum of the weights when weighted), as Hmisc::somers2. c and dxy are NULL when only one class is present. | NULL | [somers2_agg(y_true, prob)] |
| spa_test_agg | aggregate | Hansen's (2005) Superior Predictive Ability test: is any competing model better than the benchmark? | NULL | [spa_test_agg(benchmark_loss, [loss_a, loss_b], {'n_bootstrap': 999, 'block_length': 5, 'seed': 1} ORDER BY t)] |
| spa_test_agg | aggregate | Hansen's (2005) Superior Predictive Ability test: is any competing model better than the benchmark? Uses default options. | NULL | [spa_test_agg(benchmark_loss, [loss_a, loss_b] ORDER BY t)] |
| spearman2_agg | aggregate | Generalized Spearman rho^2 of a response y with a predictor x (Hmisc::spearman2): the R^2 of rank(y) on rank(x) (p = 1, the squared Spearman correlation) or on rank(x) and its square (p = 2, detects non-monotone association). Returns rho2, adjusted_rho2, the F statistic with df1 / df2, p_value, n and the unified test fields. Rows with a NULL or non-finite value are skipped. | NULL | [spearman2_agg(y, x)] |
| spearman2_agg | aggregate | Generalized Spearman rho^2 of y with a categorical x (Hmisc::spearman2(factor(x), y)): the R^2 of rank(y) on the level dummies, df1 = levels - 1. | NULL | [spearman2_agg(y, grp)] |
| spearman2_agg | aggregate | Generalized Spearman rho^2 of y with a categorical x, with options (p is ignored). | NULL | [spearman2_agg(y, grp, {'p': 1})] |
| spearman2_agg | aggregate | Generalized Spearman rho^2 with options: p (1 or 2, default 1). | NULL | [spearman2_agg(y, x, {'p': 2})] |
| spearman_agg | aggregate | Computes Spearman's rank correlation coefficient and tests its significance. | NULL | [spearman_agg(x, y)] |
| spearman_agg | aggregate | Computes Spearman's rank correlation coefficient and tests its significance. | NULL | [spearman_agg(x, y, {'alternative': 'two_sided'})] |
| spline_basis | scalar | Basis of x for a spline_spec STRUCT (fields kind and knots, optional norm, degree, extrapolation, include_bias). | NULL | [spline_basis(x, spline_spec('rcs', [10.0, 20.0, 30.0]))] |
| spline_spec | scalar | Validated definition of a spline basis: {kind, knots, norm, degree, extrapolation, include_bias, n_columns, nonlinear}. kind 'rcs' \| 'lsp' \| 'bspline'; options norm (rcs), degree, extrapolation, include_bias (bspline). Keep it next to a fit and expand new data with spline_basis(x, spec). | NULL | [spline_spec('bspline', [0.0, 5.0, 10.0], {'degree': 2})] |
| spline_spec | scalar | Validated definition of a spline basis: {kind, knots, norm, degree, extrapolation, include_bias, n_columns, nonlinear}. kind 'rcs' \| 'lsp' \| 'bspline'; options norm (rcs), degree, extrapolation, include_bias (bspline). Keep it next to a fit and expand new data with spline_basis(x, spec). | NULL | [spline_spec('rcs', [10.0, 20.0, 30.0, 40.0])] |
| t_test_agg | aggregate | Performs a two-sample t-test (Welch or Student) comparing values between two groups, using default options. | NULL | [t_test_agg(value, group_id)] |
| t_test_agg | aggregate | Performs a two-sample t-test (Welch or Student) comparing values between two groups. | NULL | [t_test_agg(value, group_id, {'alternative': 'two_sided'})] |
| t_test_one_sample_agg | aggregate | Performs a one-sample t-test of H0: mean(x) = 0, with Cohen's d, using default options. | NULL | [t_test_one_sample_agg(x)] |
| t_test_one_sample_agg | aggregate | Performs a one-sample t-test of H0: mean(x) = mu, with Cohen's d. | NULL | [t_test_one_sample_agg(x, {'mu': 5})] |
| t_test_paired_agg | aggregate | Performs a paired t-test of H0: mean(x - y) = 0, with Cohen's d_z, using default options. | NULL | [t_test_paired_agg(before, after)] |
| t_test_paired_agg | aggregate | Performs a paired t-test of H0: mean(x - y) = mu, with Cohen's d_z. | NULL | [t_test_paired_agg(before, after, {'alternative': 'two_sided'})] |
| theil_sen_fit | scalar | Fits a Theil-Sen regression model with optional MAP of settings (max_subpopulation, n_subsamples, max_iterations, tolerance, random_state, fit_intercept, compute_inference, confidence_level, ci_method ('exact' \| 'bootstrap'), n_bootstrap). | NULL | [theil_sen_fit(y, x, {'random_state': 42, 'max_subpopulation': 5000})] |
| theil_sen_fit | scalar | Fits a Theil-Sen robust regression model. Returns coefficients and fit statistics as a struct. | NULL | [theil_sen_fit(y, x)] |
| theil_sen_fit_agg | aggregate | Fits a Theil-Sen robust regression model and returns coefficients and fit statistics as a struct. | NULL | [theil_sen_fit_agg(y, x)] |
| theil_sen_fit_agg | aggregate | Fits a Theil-Sen robust regression model and returns coefficients and fit statistics as a struct. | NULL | [theil_sen_fit_agg(y, x, {'random_state': 42, 'max_subpopulation': 5000})] |
| theil_sen_fit_predict | aggregate | Window aggregate: fits a Theil-Sen regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use theil_sen_fit_predict_agg. | NULL | [theil_sen_fit_predict(y, x) OVER (PARTITION BY g ORDER BY t)] |
| theil_sen_fit_predict | aggregate | Window aggregate: fits a Theil-Sen regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use theil_sen_fit_predict_agg. | NULL | [theil_sen_fit_predict(y, x, {'random_state': 42}) OVER (...)] |
| theil_sen_fit_predict_agg | aggregate | Fits Theil-Sen on training rows with a MAP of options and predicts all rows. | NULL | [theil_sen_fit_predict_agg(y, x, split_col, {'random_state': 42})] |
| theil_sen_fit_predict_agg | aggregate | Fits Theil-Sen over a partition with a MAP of options and returns per-row predictions. | NULL | [theil_sen_fit_predict_agg(y, x, {'random_state': 42})] |
| theil_sen_fit_predict_agg | aggregate | Fits Theil-Sen using only training rows (split_col='train') and predicts all rows. | NULL | [theil_sen_fit_predict_agg(y, x, split_col)] |
| theil_sen_fit_predict_agg | aggregate | Fits a Theil-Sen robust regression over a partition and returns per-row predictions with prediction intervals. | NULL | [theil_sen_fit_predict_agg(y, x)] |
| theil_sen_fit_predict_by | table_macro | Table macro: fits a Theil-Sen regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [theil_sen_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| theil_sen_glance_by | table_macro | Table macro: fits a Theil-Sen regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [theil_sen_glance_by('my_table', group_col, y, [x1, x2])] |
| theil_sen_prediction_by | table_macro | Table macro: fits a Theil-Sen regression per group of source (theil_sen_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('theil_sen'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [theil_sen_prediction_by('sales', store, week, revenue, [price, promo])] |
| theil_sen_tidy_by | table_macro | Table macro: fits a Theil-Sen regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options, with 'ci_method': 'exact_or_none', 'n_boot': '199'). names := [...] labels the terms. | NULL | [theil_sen_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| tidy | scalar | One entry per model term (intercept first): term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value (the integration contract's terms schema). Unnest it to get a coefficient table; pass term names as a second argument. | NULL | [unnest(tidy(ols_fit_agg(y, [x1, x2], {'compute_inference': true})), recursive := true), tidy(model, ['price', 'promo'])] |
| tost_bootstrap_agg | aggregate | Tests whether two means are equivalent using a percentile-bootstrap TOST. | NULL | [tost_bootstrap_agg(value, group_id, {'delta': 0.5, 'n_bootstrap': 2000, 'seed': 42})] |
| tost_correlation_agg | aggregate | Tests equivalence of a correlation to a reference value using the TOST procedure, using default options. | NULL | [tost_correlation_agg(x, y)] |
| tost_correlation_agg | aggregate | Tests equivalence of a correlation to a reference value using the TOST procedure. | NULL | [tost_correlation_agg(x, y, {'delta': 0.1})] |
| tost_one_sample_agg | aggregate | Tests whether a mean is equivalent to mu using the Two One-Sided Tests (TOST) procedure with a one-sample t-test. | NULL | [tost_one_sample_agg(value, {'mu': 0.0, 'delta': 0.5})] |
| tost_paired_agg | aggregate | Tests equivalence of paired measurements using the TOST procedure, using default options. | NULL | [tost_paired_agg(x, y)] |
| tost_paired_agg | aggregate | Tests equivalence of paired measurements using the TOST procedure. | NULL | [tost_paired_agg(x, y, {'delta': 0.5})] |
| tost_prop_one_agg | aggregate | Tests whether a proportion is equivalent to p0 using TOST with z-tests (normal approximation). | NULL | [tost_prop_one_agg(success, {'p0': 0.5, 'delta': 0.1})] |
| tost_prop_two_agg | aggregate | Tests whether two proportions are equivalent using TOST with z-tests (normal approximation). | NULL | [tost_prop_two_agg(success, group_id, {'delta': 0.1})] |
| tost_t_test_agg | aggregate | Tests equivalence of two groups using the Two One-Sided Tests (TOST) procedure with a t-test, using default options. | NULL | [tost_t_test_agg(value, group_id)] |
| tost_t_test_agg | aggregate | Tests equivalence of two groups using the Two One-Sided Tests (TOST) procedure with a t-test. | NULL | [tost_t_test_agg(value, group_id, {'delta': 1.0})] |
| tost_wilcoxon_agg | aggregate | Tests whether the location shift of two groups is equivalent to zero using TOST with shifted Wilcoxon rank-sum tests. | NULL | [tost_wilcoxon_agg(value, group_id, {'delta': 0.5})] |
| tost_wilcoxon_paired_agg | aggregate | Tests whether the pseudo-median of paired differences is equivalent to zero using TOST with shifted Wilcoxon signed-rank tests. | NULL | [tost_wilcoxon_paired_agg(x, y, {'delta': 0.5})] |
| tost_yuen_agg | aggregate | Tests whether two trimmed means are equivalent using TOST with Yuen's test. | NULL | [tost_yuen_agg(value, group_id, {'delta': 0.5, 'trim': 0.2})] |
| tukey_hsd_agg | aggregate | Tukey's honest significant difference for all pairwise differences of group means (R TukeyHSD(aov(value ~ group))). Returns one row per pair with the simultaneous confidence interval (conf_low, conf_high) and family-wise p_adj. Options: confidence_level (default 0.95). | NULL | [tukey_hsd_agg(value, group, {'confidence_level': 0.95})] |
| tukey_hsd_by | table_macro | Table macro: runs Tukey's HSD (R TukeyHSD(aov(...))) between the levels of factor_col within each group of source and returns one row per pair (the integration contract's `test` schema): the group column, model_id, test_id ('-'), method, statistic, p_value, group1, group2, p_adj, df1, df2, estimate, conf_low, conf_high, conf_level, effect_size, effect_name, alternative, p_adjust_method. options are passed to tukey_hsd_agg. | NULL | [tukey_hsd_by('my_table', experiment, response, treatment)] |
| tvd_agg | aggregate | Total variation distance between the category distributions of two groups, with a seeded permutation p-value (evidently 'TVD'). | NULL | [tvd_agg(value, group_id, {'n_permutations': 1000, 'seed': 42})] |
| tvd_agg | aggregate | Total variation distance between the category distributions of two groups, with a seeded permutation p-value (evidently 'TVD'). Default options. | NULL | [tvd_agg(value, group_id)] |
| tweedie_augment_agg | aggregate | Fits a Tweedie GLM (log link) over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [tweedie_augment_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| tweedie_augment_agg | aggregate | Fits a Tweedie GLM (log link) over a partition (rows with y and every feature present) and returns one STRUCT per row, in frame order, with fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (broom augment) and approx_loo_fitted / approx_loo_residual (one-step approximate leave-one-out). Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [tweedie_augment_agg(y, [x1, x2], {'power': 1.5}) OVER ()] |
| tweedie_augment_by | table_macro | Table macro: fits a Tweedie GLM (log link) per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted (response scale), residual (deviance), resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, approx_loo_fitted and approx_loo_residual (one-step approximate leave-one-out prediction and residual, response scale: not the refit). Non-training rows get the prediction as fitted and NULL diagnostics. Penalized fits (glm_lambda > 0 or a prior) are rejected. | NULL | [tweedie_augment_by('my_table', group_col, y, [x1, x2])] |
| tweedie_effects_by | table_macro | Table macro: marginal-effect grid of a Tweedie GLM per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of tweedie_tidy_by). | NULL | [tweedie_effects_by('sales', store, revenue, [price, promo], focal := 1, n_points := 25, names := ['price', 'promo'])] |
| tweedie_fit_agg | aggregate | Fits a Tweedie GLM (log link, default power = 1.5 — compound Poisson-Gamma) and returns coefficients, deviance, AIC, dispersion (= phi), and fit statistics. | NULL | [tweedie_fit_agg(y, x)] |
| tweedie_fit_agg | aggregate | Fits a Tweedie GLM (log link, user-specified power 1 < p < 2 for compound Poisson-Gamma) and returns coefficients, deviance, AIC, dispersion (= phi), and fit statistics. Default power is 1.5. | NULL | [tweedie_fit_agg(y, x, {'power': 1.5, 'fit_intercept': true})] |
| tweedie_fit_agg | aggregate | Fits the same model with a cluster-robust (sandwich::vcovCL(glm)) coefficient covariance: std_errors, z tests and vcov are clustered, plus vcov_type and n_clusters. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering; needs 'vcov': 'cluster' in the options. 'hc_type': 'hc0' (default) or 'hc1', 'cadjust' (default true); with priors or glm_lambda the penalized bread is used. compute_inference defaults to true. | NULL | [tweedie_fit_agg(y, [x1, x2], firm_id, {'vcov': 'cluster'})] |
| tweedie_fit_agg | aggregate | Fits the same model with prior (case) weights w, as R's glm(weights = w); a NULL weight drops the row. | NULL | [tweedie_fit_agg(y, x, w), tweedie_fit_agg(y, x, w, {'compute_inference': true})] |
| tweedie_fit_predict_by | table_macro | Table macro: fits a Tweedie GLM per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [tweedie_fit_predict_by('my_table', group_col, y, [x1, x2])] |
| tweedie_glance_by | table_macro | Table macro: fits a Tweedie GLM per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [tweedie_glance_by('my_table', group_col, y, [x1, x2])] |
| tweedie_partial_residuals_agg | aggregate | Fits a Tweedie GLM (log link) over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots; the working residual), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots; NULL for GLMs). Rows not used for fitting get NULL residuals. | NULL | [tweedie_partial_residuals_agg(y, [x1, x2]) OVER (PARTITION BY g)] |
| tweedie_partial_residuals_by | table_macro | Table macro: fits a Tweedie GLM per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= working residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (NULL for GLMs). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [tweedie_partial_residuals_by('my_table', group_col, y, [x1, x2])] |
| tweedie_prediction_by | table_macro | Table macro: fits a Tweedie GLM per group of source (tweedie_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('tweedie'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [tweedie_prediction_by('sales', store, week, revenue, [price, promo])] |
| tweedie_tidy_by | table_macro | Table macro: fits a Tweedie GLM per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [tweedie_tidy_by('my_table', group_col, y, [x1, x2], names := ['x1', 'x2'])] |
| two_way_anova_agg | aggregate | Two-way ANOVA with interaction: one list element each for factor A, factor B and the A x B interaction, with Type III sums of squares (R's car::Anova(lm(y ~ a * b), type = 3) with sum contrasts; equal to summary(aov()) for balanced designs). Fields: term, method, statistic (F), df1, df2 (residual df), p_value, sum_sq, mean_sq, residual_sum_sq, residual_mean_sq, n_observations and effect_size (partial eta squared). Every factor combination must be observed. Options: terms (labels of the two factors, default ['factor_a', 'factor_b']). | NULL | [two_way_anova_agg(yield, fertilizer, variety), two_way_anova_agg(yield, fertilizer, variety, {'terms': ['fertilizer', 'variety']})] |
| val_prob_agg | aggregate | External validation of predicted probabilities against 0/1 outcomes, as rms::val.prob(pl = FALSE): dxy, c, r2, the discrimination index d (d_chisq, d_p), the unreliability index u (u_chisq, u_p), the quality index q = d - u, brier, the calibration intercept and slope, emax / e90 / eavg of the lowess calibration curve and Spiegelhalter's s_z / s_p. | NULL | [val_prob_agg(y_true, prob)] |
| validate_agg | aggregate | Resampling validation of a regression model (rms::validate): one row per index with index_orig (apparent), training, test, optimism, index_corrected (index_orig - optimism), n (resamples used) and n_failed. ols indexes: R-square, MSE, g, Intercept, Slope; logistic: Dxy, R2, Intercept, Slope, Emax, D, U, Q, B, g, gp. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. | NULL | [validate_agg(y, [x1, x2])] |
| validate_agg | aggregate | Resampling validation of a regression model (rms::validate): one row per index with index_orig (apparent), training, test, optimism, index_corrected (index_orig - optimism), n (resamples used) and n_failed. ols indexes: R-square, MSE, g, Intercept, Slope; logistic: Dxy, R2, Intercept, Slope, Emax, D, U, Q, B, g, gp. The model is a linear model (rms::ols, model 'ols', the default) or a binary logistic model (rms::lrm, model 'logistic', y in {0, 1}) with an intercept, of y on the columns of x. Rows with a NULL or non-finite y or x are skipped; the rows are sorted canonically, so a seed gives the same resamples whatever the thread count. Options: model ('ols' \| 'logistic'), method ('boot' optimism bootstrap, the default \| 'crossvalidation' \| '.632'), B (resamples or cross-validation groups, default 40), seed (default 42). | NULL | [validate_agg(y, [x1, x2], {'model': 'logistic', 'B': 200, 'seed': 1})] |
| validate_by | table_macro | Table macro: resampling validation (validate_agg, same options) per group of source, one row per index: the group column, index_name, index_orig, training, test, optimism, index_corrected, n, n_failed, model, method. | NULL | [validate_by('patients', site, died, [age, sbp], options := {'model': 'logistic', 'B': 200})] |
| varclus_agg | aggregate | Variable clustering (Hmisc::varclus): the similarity of every pair of features (squared Spearman correlation by default) clustered hierarchically on 1 - similarity (complete linkage). Returns variables, similarity, merges (R's hclust convention: -j is variable j, k the cluster of step k), height, dendrogram_order, clusters (NULL without cut_height) and n_observations. Rows with a NULL or non-finite element are skipped. | NULL | [varclus_agg([x1, x2, x3])] |
| varclus_agg | aggregate | Variable clustering with options: similarity (spearman, pearson, hoeffding), trans (square, abs, none), method (complete, single, average, mcquitty, median, centroid, ward.d, ward.d2), cut_height (cluster labels of the tree cut there), feature_names. | NULL | [varclus_agg([x1, x2, x3], {'cut_height': 0.5})] |
| vif | scalar | Computes Variance Inflation Factor (VIF) for each column of a feature matrix to detect multicollinearity. | NULL | [vif(x)] |
| vif_agg | aggregate | Aggregate version of VIF: computes Variance Inflation Factor for each feature from a column of feature vectors. | NULL | [vif_agg(x)] |
| wald_anova | scalar | rms-style ANOVA table of Wald chunk tests (rms::anova.rms) from a fitted model's coefficients and covariance: per term the test of all its columns (with its interactions), its nonlinear and interaction chunks, then TOTAL NONLINEAR, TOTAL INTERACTION and TOTAL. terms: one label per coefficient; options: nonlinear (BOOLEAN[]), interactions (MAP label -> [factor_a, factor_b]), test ('auto' = F for linear models, 'chisq', 'F'). | NULL | [wald_anova(ols_fit_agg(y, [x1, x2, x3], {'compute_inference': true}), ['a', 'a', 'b'])] |
| wasserstein_agg | aggregate | 1-D Wasserstein (earth mover's) distance, raw and normed by the reference's population SD (evidently), with an optional permutation p-value. | NULL | [wasserstein_agg(value, group_id, {'p': 1, 'n_permutations': 1000})] |
| wasserstein_agg | aggregate | 1-D Wasserstein (earth mover's) distance, raw and normed by the reference's population SD (evidently), with an optional permutation p-value. Default options. | NULL | [wasserstein_agg(value, group_id)] |
| white_test_agg | aggregate | White's test for heteroskedasticity: the studentized Breusch-Pagan test against x, its squares and pairwise cross-products (R bptest(fit, ~ x1 * x2 + I(x1^2) + I(x2^2))). | NULL | [white_test_agg(resid, [x1, x2])] |
| wilcoxon_signed_rank_agg | aggregate | Performs the Wilcoxon signed-rank test for paired samples, using default options. | NULL | [wilcoxon_signed_rank_agg(x, y)] |
| wilcoxon_signed_rank_agg | aggregate | Performs the Wilcoxon signed-rank test for paired samples. | NULL | [wilcoxon_signed_rank_agg(x, y, {'alternative': 'two_sided'})] |
| wls_augment_agg | aggregate | Fits WLS over a partition (rows with y, every feature and a positive weight) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training and n_params (broom augment). | NULL | [wls_augment_agg(y, [x1, x2], w) OVER (PARTITION BY g)] |
| wls_augment_agg | aggregate | Fits WLS over a partition (rows with y, every feature and a positive weight) and returns one STRUCT per row, in frame order, with fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training and n_params (broom augment). | NULL | [wls_augment_agg(y, [x1, x2], w, {'fit_intercept': true}) OVER ()] |
| wls_augment_by | table_macro | Table macro: fits a weighted least squares (WLS) regression per group of source (training rows: y_col NOT NULL, a positive weight and split omitted or 'train' / 'training' in any case) and returns every source row with the per-observation diagnostics of the fit (broom augment, contract obs schema): model_id and model_name (the method; the group column is among the source columns), row_id, fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params, loo_residual and loo_fitted (exact leave-one-out on the response scale: residual / (1 - leverage) and y minus it, NULL where leverage = 1). Non-training rows get the prediction as fitted and NULL diagnostics. | NULL | [wls_augment_by('my_table', group_col, y, [x1, x2], w)] |
| wls_effects_by | table_macro | Table macro: marginal-effect grid of a weighted least squares regression per group of source: the fitted mean over n_points values spanning the range of feature focal (1-based position in x_cols), with the other features at their group means over the fitted rows (or at at_values, a list with one value per feature), and its confidence band at level from predict(model, x, {'interval': 'confidence'}) (response scale for GLMs). Integration contract `prediction` schema: the group column, id, model_id, model_name, focal, x (the focal value), y (NULL), yhat, yhat_lower, yhat_upper, level, split (NULL), se_fit, focal_name (the focal feature's name: names[focal] when names := [...] is given, else 'x' \|\| focal, as the terms of wls_tidy_by). | NULL | [wls_effects_by('sales', store, revenue, [price, promo], w, focal := 1, n_points := 25, names := ['price', 'promo'])] |
| wls_fit | scalar | Fits a WLS regression model with optional MAP of settings (fit_intercept, compute_inference, confidence_level, solver, hc_type, alias_tolerance, compute_loo). | NULL | [wls_fit(y, x, weights, {'compute_inference': true})] |
| wls_fit | scalar | Fits a Weighted Least Squares (WLS) regression model using per-observation weights. | NULL | [wls_fit(y, x, weights)] |
| wls_fit_agg | aggregate | Fits WLS with a cluster-robust (sandwich::vcovCL) coefficient covariance: std_errors, tests, the F test and vcov are clustered. cluster: one id per row of any type, or a LIST / STRUCT of ids for multiway clustering. Options as the sibling plus 'cadjust' (default true); 'hc_type' picks vcovCL's type (default HC1, i.e. Stata's CR1); compute_inference defaults to true. | NULL | [wls_fit_agg(y, [x1, x2], w, [firm_id, year], MAP {})] |
| wls_fit_agg | aggregate | Fits a Weighted Least Squares regression model and returns coefficients and fit statistics. | NULL | [wls_fit_agg(y, x, weight)] |
| wls_fit_agg | aggregate | Fits a Weighted Least Squares regression model and returns coefficients and fit statistics. | NULL | [wls_fit_agg(y, x, weight, {'fit_intercept': true})] |
| wls_fit_from_state | scalar | Fits WLS from a weighted least-squares state (ls_state_agg(y, x, weight)): the same STRUCT as wls_fit_agg on the rows. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [wls_fit_from_state(state)] |
| wls_fit_from_state | scalar | Fits WLS from a weighted least-squares state (ls_state_agg(y, x, weight)): the same STRUCT as wls_fit_agg on the rows. Row-level options (hc_type, compute_loo) need the rows and raise an error. | NULL | [wls_fit_from_state(state, {'compute_inference': true})] |
| wls_fit_predict | aggregate | Window aggregate: fits a weighted least squares (WLS) regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use wls_fit_predict_agg. | NULL | [wls_fit_predict(y, x, weight)] |
| wls_fit_predict | aggregate | Window aggregate: fits a weighted least squares (WLS) regression on the rows of the window frame and returns the prediction (with interval) for the LAST row of the frame. Use frames ending at CURRENT ROW over a unique ordering; for per-row predictions over a whole group use wls_fit_predict_agg. | NULL | [wls_fit_predict(y, x, weight, {'null_policy': 'drop'})] |
| wls_fit_predict_agg | aggregate | Fits WLS regression on training rows with weights and a MAP of options and predicts all rows. | NULL | [wls_fit_predict_agg(y, x, weights, split_col, {'null_policy': 'drop'})] |
| wls_fit_predict_agg | aggregate | Fits WLS regression over a partition using weights and returns per-row predictions. | NULL | [wls_fit_predict_agg(y, x, weights)] |
| wls_fit_predict_agg | aggregate | Fits WLS regression over a partition using weights with a MAP of options and returns per-row predictions. | NULL | [wls_fit_predict_agg(y, x, weights, {'null_policy': 'drop'})] |
| wls_fit_predict_agg | aggregate | Fits WLS regression using only training rows (split_col='train') with weights and predicts all rows. | NULL | [wls_fit_predict_agg(y, x, weights, split_col)] |
| wls_fit_predict_by | table_macro | Table macro: fits a weighted least squares (WLS) regression per group of source (training rows: y_col NOT NULL and split omitted or 'train' / 'training' in any case) and returns every source row with yhat (plus yhat_lower / yhat_upper prediction-interval bounds where the model provides them) and is_training appended. | NULL | [wls_fit_predict_by('my_table', group_col, y, [x1, x2], weight)] |
| wls_glance_by | table_macro | Table macro: fits a weighted least squares regression per group of source and returns its fit statistics in long form, one row per available metric: the group column, id (the group), model_id and model_name (the method), model_type, metric, value. | NULL | [wls_glance_by('my_table', group_col, y, [x1, x2], w)] |
| wls_partial_residuals_agg | aggregate | Fits WLS over a partition and returns, per row in frame order, a LIST with one STRUCT per fitted term: term_index (1-based position in x), x, partial_residual = residual + component (R residuals(type = 'partial'), car::crPlots), component = b_j (x_j - mean(x_j)), and the added-variable coordinates x_residual, y_residual (car::avPlots). Rows not used for fitting get NULL residuals. | NULL | [wls_partial_residuals_agg(y, [x1, x2], w) OVER (PARTITION BY g)] |
| wls_partial_residuals_by | table_macro | Table macro: fits a weighted least squares regression per group of source and returns one row per input row and fitted term with partial-residual (component-plus-residual, car::crPlots) and added-variable (car::avPlots) coordinates: the group column, id (the group), model_id and model_name (the method), row_id, term_index, term, x, partial_residual (= residual + component), component (b_j (x_j - mean(x_j))), x_residual, y_residual (x_j and y residualised on the other columns). Rows not used for fitting get NULL residuals. names := [...] labels the terms. | NULL | [wls_partial_residuals_by('my_table', group_col, y, [x1, x2], w)] |
| wls_prediction_by | table_macro | Table macro: fits a weighted least squares regression per group of source (wls_fit_predict_by) and returns one row per input row in the integration contract's `prediction` schema: the group column, id, model_id, model_name ('wls'), x (x_col, the plot position and row order), y, yhat, yhat_lower, yhat_upper (the interval at level, default 0.95, overriding any confidence_level in options), level (NULL on rows without a band), split ('train' for fitted rows, 'future' for rows with a NULL y, 'test' for rows held out by split). | NULL | [wls_prediction_by('sales', store, week, revenue, [price, promo], w)] |
| wls_rolling_tidy_by | table_macro | Table macro: fits a weighted least squares regression over a trailing window of window_size rows (ordered by order_col) within each group of source and returns the coefficients of every window as `terms` rows (integration contract): the group column, id (the group), model_id and model_name (the method), window_end (order_col of the window's last row), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name ('window_end'), index_value (the window's 1-based end position in its group) and n_window. Windows with fewer than min_obs rows (default window_size) are skipped. | NULL | [wls_rolling_tidy_by('my_table', group_col, t, y, [x1, x2], w, window_size := 24)] |
| wls_tidy_by | table_macro | Table macro: fits a weighted least squares regression per group of source and returns one row per term (intercept first): the group column, id (the group), model_id and model_name (the method), term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value. Inference is computed by default (compute_inference is merged under options). names := [...] labels the terms. | NULL | [wls_tidy_by('my_table', group_col, y, [x1, x2], w, names := ['x1', 'x2'])] |
| yuen_agg | aggregate | Performs Yuen's trimmed-means t-test, robust to outliers and non-normality, using default options. | NULL | [yuen_agg(value, group_id)] |
| yuen_agg | aggregate | Performs Yuen's trimmed-means t-test, robust to outliers and non-normality. | NULL | [yuen_agg(value, group_id, {'trim': 0.2})] |
| z_drift_agg | aggregate | Two-proportion z test of the share of the non-smallest category, current against reference (evidently 'z'; R prop.test(correct = FALSE)). Drift by evidently's rule at p_value < 0.05. | NULL | [z_drift_agg(value, group_id, {'alternative': 'two_sided'})] |
| z_drift_agg | aggregate | Two-proportion z test of the share of the non-smallest category, current against reference (evidently 'z'; R prop.test(correct = FALSE)). Drift by evidently's rule at p_value < 0.05. Default options. | NULL | [z_drift_agg(value, group_id)] |
### Overloaded Functions
This extension does not add any function overloads.
### Added Types
This extension does not add any types.
### Added Settings
| name | description | input_type | scope | aliases | typed_value |
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------|------------|--------|---------|-------------------------------------------------|
| anofox_telemetry_enabled | Enable or disable anonymous usage telemetry | BOOLEAN | GLOBAL | [] | true |
| anofox_telemetry_key | PostHog API key for telemetry | VARCHAR | GLOBAL | [] | phc_t3wwRLtpyEmLHYaZCSszG0MqVr74J6wnCrj9D41zk2t |
| datazoo_banner | Show the DataZoo feedback banner when an extension is loaded in an interactive terminal (at most once a day per extension). | BOOLEAN | GLOBAL | [] | true |
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |