LogisticRegression
Logistic-regression family for associate$regression()
Description
LogisticRegression implements binomial generalized linear models for binary outcomes. It supports the same covariate, split.by, and interaction surface as LinearRegression, but reports estimates on the log-odds scale.
Summary rows follow the glm association schema. Returned artifacts are:
-
prediction.grid, a probability-scale effect grid for the tested predictor
Super class
PolyGenius::RegressionFamily -> LogisticRegression
Methods
Public methods
Inherited methods
Method new()
Register the canonical family key used by the engine.
Usage
LogisticRegression$new()
Returns
The initialized family object with family.name = “glm”.
Method validate.frame()
Ensure the resolved outcome is binary before fitting.
Usage
LogisticRegression$validate.frame(frame, cell, fit.specs, conf.level)
Arguments
-
frame -
Cell-specific
PolyGeniusFrame. -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
Returns
Invisibly TRUE when validation succeeds.
Method prepare.frame()
Build the complete-case logistic-regression payload.
Usage
LogisticRegression$prepare.frame(frame, cell, fit.specs, conf.level)
Arguments
-
frame -
Cell-specific
PolyGeniusFrame. -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
Returns
A model-ready fit payload with the outcome coded as 0/1.
Method build.formula()
Build the logistic-regression formula for one fit payload.
Usage
LogisticRegression$build.formula(frame)
Arguments
-
frame -
Fit payload returned by
prepare.frame().
Returns
A model formula object.
Method fit.model()
Fit the binomial generalized linear model for one cell.
Usage
LogisticRegression$fit.model(formula, frame, ...)
Arguments
-
formula -
Model formula returned by
build.formula(). -
frame -
Fit payload returned by
prepare.frame(). -
… -
Additional arguments passed to
stats::glm().
Returns
A fitted stats::glm object.
Method build.summary.rows()
Convert the fitted logistic model to regression-schema rows.
Usage
LogisticRegression$build.summary.rows( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
stats::glmobject. -
fit.data -
Fit payload returned by
prepare.frame(). -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
-
formula -
Display formula string.
Returns
A data frame following the concrete association schema.
Method build.artifacts()
Return probability-grid and profile artifacts.
Usage
LogisticRegression$build.artifacts( fit, fit.data, cell, fit.specs, conf.level, formula )
Arguments
-
fit -
Fitted
stats::glmobject. -
fit.data -
Fit payload returned by
prepare.frame(). -
cell -
Named fit-grid cell.
-
fit.specs -
Additional family-specific fitting arguments.
-
conf.level -
Confidence level for intervals.
-
formula -
Display formula string.
Returns
A named list with prediction.grid and profile.table.
Method clone()
The objects of this class are cloneable with this method.
Usage
LogisticRegression$clone(deep = FALSE)
Arguments
-
deep -
Whether to make a deep clone.