glm-factor-optimizer Documentation

glm-factor-optimizer helps you design GLM factors in a way that is easy to inspect, rerun, and save. Use it to learn numeric bins, group categorical levels, rank candidate factors, compare validation results, and preserve the choices as reviewable artifacts.

For LLM-assisted workflows, start with the LLM Quickstart, the sitemap, or the plain-text llms.txt project map.

A typical modeling session looks like this:

  1. Split data into train, validation, and holdout.
  2. Rank coarse candidate factors.
  3. Work factor by factor with FactorBlock.
  4. Accept bins/groups deliberately after inspection.
  5. Fit the current main-effects model.
  6. Refine accepted factors with the full model fixed.
  7. Search and test candidate interactions.
  8. Finalize once on holdout.
  9. Save specs, history, metrics, and validation tables.

Documentation Map

Tutorial:

Discovery:

How-to guides:

Reference:

Explanation:

Main Interfaces

Use GLMStudy for iterative notebook modeling:

from glm_factor_optimizer import GLMStudy

study = GLMStudy(
    df,
    target="events",
    exposure="hours",
    prediction="predicted_count",
)

Use RateGLM or GLM for low-level manual work:

from glm_factor_optimizer import RateGLM

glm = RateGLM(target="events", exposure="hours")

Use GLMWorkflow for compact batch baselines:

from glm_factor_optimizer import GLMWorkflow

Use glm_factor_optimizer.spark for Spark-oriented primitives.