Metaheuristic-Optimized Logistic Regression (PSO-LR / MOLR)
Project description
PSO-LR: Metaheuristic-Optimized Logistic Regression (MOLR)
PSO-LR is an open-source, sklearn-compatible implementation of
Metaheuristic-Optimized Logistic Regression (MOLR), where model parameters
are estimated using Particle Swarm Optimization (PSO) instead of
gradient-based solvers.
This framework preserves the classical interpretability of logistic regression while improving robustness, global convergence behavior, and stability in noisy or ill-conditioned datasets.
Motivation
Traditional logistic regression relies on gradient-based optimization (LBFGS, Newton-CG, SGD). These methods can struggle when data exhibits:
- Multicollinearity
- Noisy or sparse signals
- Poor conditioning
- Strong regularization requirements
PSO-LR replaces gradient descent with a population-based global optimizer, making it suitable for:
- Marketing analytics
- Choice modeling
- Behavioral modeling
- Econometrics
- High-noise real-world datasets
Key Features
- Binary & Multinomial Logistic Regression
- Particle Swarm Optimization (PSO)
- Early stopping for efficiency
- L1 / L2 regularization
- Hard coefficient constraints
- Fully sklearn-compatible API
- Interpretable coefficients & odds ratios
- Domain-independent design
Mathematical Formulation
The logistic model remains unchanged:
[ P(y=1|x) = \sigma(x^\top \beta) ]
The regularized negative log-likelihood is optimized using PSO:
[ \min_{\beta} ; -\mathcal{L}(\beta) + \lambda \Omega(\beta) ]
PSO searches the parameter space globally without requiring gradients, ensuring robust convergence.
Installation
pip install psolr
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file psolr-0.1.0.tar.gz.
File metadata
- Download URL: psolr-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4ad998178b5f8feb4353fc0492d561600efc93b9892be6a92f26ce9bea920e6
|
|
| MD5 |
1d9efdb57162b92cedd9479196b3d100
|
|
| BLAKE2b-256 |
f5bc349285cd45340d0cbe23a7aeac010215ee0d4ae9a2b1a6b858f21471abcd
|
File details
Details for the file psolr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: psolr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5c84ede15de2f527c301bf719c2d7aa49bf05e56ff5cc04640cef5e4aecb205
|
|
| MD5 |
9b60866b6907dde33ada5160e42e5d66
|
|
| BLAKE2b-256 |
dffb2e43c13a4da7a158fd5ccb994471e23053aa65b525026558bd1048d7108f
|