Generalised linear model with R's glm(): gaussian, binomial (logistic), poisson or Gamma regression. Name the model with a formula, or with a target and a column selector for the features. Writes a fitted SpadeModel that models.predict scores without R (predictions on the response scale), the coefficient table, and the fit statistics, with optional cross-validation. A model that does not converge fails rather than being written. For tables too large for memory, models.glm fits the same model by streaming.
Training table: one row per observation, with the target, the predictor columns, and any weights or id columns.
formula
string
Model formula, e.g. ESTIMATE ~ B5 + log(B25) + FORTYPE + 0. Use instead of target and features. Default empty.
target
string
The response column (when no formula is given). Default empty.
features
string
Column selector for the predictors (when no formula is given): names, globs and exclusions, e.g. B*,MB*,-B0. Default empty.
intercept
boolean
Include an intercept when building the model from target and features. With a formula, write + 0 in the formula instead. Default true.
distribution
string
Response distribution: gaussian (default), binomial (0/1, TRUE/FALSE or a proportion with the number of trials as weights), poisson (counts) or Gamma (positive values).
link
string
Link function: canonical (default; the distribution's own), identity, log, logit or inverse. Supported: gaussian identity/log/inverse, binomial logit, poisson log/identity, Gamma inverse/log/identity.
id_columns
string
Column selector for identifier columns, never used as predictors; kept as text when reading CSV. Default empty.
weights
string
Column of non-negative observation weights. Empty fits unweighted.
categorical
string
Column selector for predictors to treat as categorical even though they are stored as numbers. Default empty.
na_action
string
fail (default, naming the columns) or drop: what to do with a row that has a missing value in a model column.
seed
number
Seed for cross-validation fold assignment. Default 0.
cv_folds
number
K-fold cross-validation (0 for none). The model is always fitted on all rows. Default 0.
cv_group
string
Column whose values are kept together in one fold (e.g. a county id), so spatially related rows do not leak between folds. Default empty.
max_iter
number
Maximum IRLS iterations; a model that has not converged fails. Default 25.
One row per design column: term, estimate, std_error, statistic, p_value.
fit
json
Rows used and dropped, the arguments that shaped the fit, and metrics: rmse and mae on the response scale, deviance, null_deviance, aic, bic, dispersion, df_residual, iterations, and cv_rmse, cv_mae, cv_r_squared when cross-validated.