You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LogisticRegression currently provides maintained binary logistic/probit behavior across NumPy, CuPy, and Torch. Multiclass multinomial/softmax support remains a central linear-model API gap, but the base statistical contract should be stabilized before any penalized capability is exposed.
Define the complete public contract for multinomial logistic regression and implement a bounded unpenalized-only Phase-1 estimator covering probability prediction, hard prediction, likelihood diagnostics, and model-based inference.
Penalized multinomial support is intentionally excluded from this issue. The complete penalized surface, including L2/L1/ElasticNet/SCAD/MCP and direct-fit/CV closure, is tracked as one coherent work package in #98.
Design decisions required before implementation
Identifiability
Choose and document one primary convention:
reference-class coefficients; or
sum-to-zero coefficients.
The public representation, internal representation, covariance rank, inference degrees of freedom, and external mapping must be explicit. Do not mix conventions across fit, prediction, and summary.
Public shapes
Define:
coef_ and intercept_ shape;
class ordering and classes_;
decision_function shape;
predict_proba shape;
binary compatibility behavior if the same class handles two classes;
covariance and standard-error tensor/matrix layout;
summary row naming.
Objective and weighting
Document:
average versus summed negative log-likelihood;
intercept handling;
analytic sample_weight semantics;
class_weight interaction with sample weights;
row-replication equivalence where applicable;
information-criterion parameter count.
No regularization parameter, penalty selector, alpha/lambda/C path, or penalized objective belongs to this issue.
Solver matrix
Phase 1 should define and validate:
solver="auto" routing for the unpenalized objective;
Newton or trust-region behavior for moderate dimensions;
L-BFGS/L-BFGS-B behavior;
stopping criteria and convergence diagnostics;
warm-start parameter shape and validation where supported;
numerical stabilization for log-sum-exp and probabilities.
Penalized solvers and penalty dispatch are deferred in full to #98.
Phase-1 public scope
fit unpenalized multinomial logistic regression;
decision_function;
predict_proba;
integer/class-label predict;
log-likelihood and convergence diagnostics;
AIC/BIC under the documented parameter count;
model-based covariance, standard errors, test statistics, p-values, and confidence intervals where identifiable;
formula/dataframe and array APIs if current LogisticRegression exposes formulas;
sklearn cloning, tags, pipeline, set_params, and fitted-state behavior.
Backend contract
NumPy CPU;
CuPy CUDA;
Torch CUDA;
backend-native objective, gradient, Hessian/Hessian-vector operations, probability prediction, and covariance computation;
explicit device requests must not silently fall back;
full GPU arrays must not be copied to NumPy for routine fitting or inference bookkeeping;
dtype and device normalization must preserve the 0.2.4 public-constructor clone contract.
External alignment
Use matched comparisons against:
sklearn multinomial LogisticRegression with penalty=None or the closest exact unpenalized configuration;
statsmodels MNLogit for likelihood and inference;
R nnet::multinom or an equivalent authoritative baseline for coefficient/prediction mapping.
Alignment must explicitly state:
reference class or coefficient transformation;
objective normalization;
intercept treatment;
class ordering;
sample/class weights;
solver and tolerance;
parameter count used by AIC/BIC.
Formula and input validation
Cover:
at least three distinct classes;
string, integer, and ordered label inputs;
deterministic class ordering;
missing classes in validation/prediction data;
one-class and two-class behavior;
finite inputs and weights;
sample-weight shape/device/dtype;
warm-start class or feature mismatch;
categorical formula terms and prediction-column alignment.
Non-goals
no L2, L1, ElasticNet, SCAD, MCP, adaptive, group, or other penalty in Phase 1;
no multinomial CV in this issue because the public capability is non-tunable;
no one-vs-rest implementation presented as multinomial softmax;
no sparse-input support;
no silent conversion to CPU or binary fallback.
Required validation
exact softmax/log-sum-exp unit tests;
gradient and Hessian checks;
identifiability/rank tests;
invariance to allowed coefficient reparameterization;
Context
LogisticRegressioncurrently provides maintained binary logistic/probit behavior across NumPy, CuPy, and Torch. Multiclass multinomial/softmax support remains a central linear-model API gap, but the base statistical contract should be stabilized before any penalized capability is exposed.Roadmap: PR #89.
Goal
Define the complete public contract for multinomial logistic regression and implement a bounded unpenalized-only Phase-1 estimator covering probability prediction, hard prediction, likelihood diagnostics, and model-based inference.
Penalized multinomial support is intentionally excluded from this issue. The complete penalized surface, including L2/L1/ElasticNet/SCAD/MCP and direct-fit/CV closure, is tracked as one coherent work package in #98.
Design decisions required before implementation
Identifiability
Choose and document one primary convention:
The public representation, internal representation, covariance rank, inference degrees of freedom, and external mapping must be explicit. Do not mix conventions across fit, prediction, and summary.
Public shapes
Define:
coef_andintercept_shape;classes_;decision_functionshape;predict_probashape;Objective and weighting
Document:
sample_weightsemantics;class_weightinteraction with sample weights;No regularization parameter, penalty selector, alpha/lambda/C path, or penalized objective belongs to this issue.
Solver matrix
Phase 1 should define and validate:
solver="auto"routing for the unpenalized objective;Penalized solvers and penalty dispatch are deferred in full to #98.
Phase-1 public scope
decision_function;predict_proba;predict;LogisticRegressionexposes formulas;set_params, and fitted-state behavior.Backend contract
External alignment
Use matched comparisons against:
LogisticRegressionwithpenalty=Noneor the closest exact unpenalized configuration;MNLogitfor likelihood and inference;nnet::multinomor an equivalent authoritative baseline for coefficient/prediction mapping.Alignment must explicitly state:
Formula and input validation
Cover:
Non-goals
Required validation
Acceptance criteria
Dependency and follow-up