Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
modelType: "logistic_regression" — a single-layer linear model: dot-product the customer’s feature vector with a learned weight vector, add a bias, push through a sigmoid. Probably the most-deployed classifier in production decisioning systems for a reason: cheap to train, cheap to score, easy to defend.
When to use
- You have ≥ 1k labeled outcomes and numeric features — the linear weighted-sum structure benefits from numeric inputs (categoricals need one-hot).
- You need calibrated probabilities for budget pacing or expected-value calculations — the sigmoid output is calibrated within the linear region.
- You’re comparing against a Bayesian baseline — logistic and Bayesian are the two “first-real-model” picks. Train both, A/B test them via
shadowModelKeys[].
gradient_boosted instead.
The math
Fixture config
0.930 for the standard test customer. Highest contribution: credit_score × 760 × 0.005 = 3.8 (raw); next income × 95000 × 0.00002 = 1.9.
Training
POST /api/v1/algorithm-models/<id>/train runs SGD over the observed interactions. Weights converge to maximize log-likelihood. The training routine’s hyperparameters (learning rate, L2 strength, epoch count) live on model.config:
segment="Gold" to 1 if present, 0 if absent. Multi-valued categoricals (segment ∈ ) need 4 binary features.
Score interpretation
score∈[0, 1]— calibrated probability.explanations[]— per-feature contributionweight × value, sorted by absolute magnitude. Positive contributions push toward responding.
Pitfalls
- Categoricals treated as scalars —
segment = 3for Gold is nonsense (no ordinal relationship). Always one-hot expand. - Unscaled features —
credit_score(300–850) andincome(0–500000) on the same model dominateage(18–80). Standardize to z-scores or min-max normalize before training, otherwise weights for small-magnitude features get pushed to zero by L2. - Multicollinearity — heavily correlated features split the credit; explanations become misleading. Drop one of each correlated pair.
- Missing intercept — leaving
biasat 0 forces every score through the origin. Always include the bias term. - Class imbalance — if positive rate is 1% and the loss is unweighted, the model learns to always predict “negative”. Use class weighting or downsample negatives in training.
Cross-reference
- Algorithm Selection Guide.
- Bayesian — natural baseline comparison.
- Gradient Boosted Trees — pick this instead when interactions matter.