Metadata-Version: 2.4
Name: metaheuristicpy
Version: 3.3.0
Summary: A Python-based package of Metaheuristic Optimization Algorithms for Solving Continous and Discrete Optimization Problem
Author: I Made Satria Bimantara
Author-email: satriabimantara.imd@gmail.com
Keywords: Optimization,Metaheuristic,Swarm Intelligence,Evolutionary Algorithm,Soft Computing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Framework :: Jupyter
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Indonesian
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas==1.5.3
Requires-Dist: numpy==1.24.2
Requires-Dist: openpyxl==3.1.5
Requires-Dist: matplotlib==3.6.3
Requires-Dist: seaborn==0.11.1
Requires-Dist: scipy==1.10.0
Requires-Dist: scikit-learn==1.2.1
Provides-Extra: cec
Requires-Dist: opfunu==1.0.0; extra == "cec"
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Provides-Extra: fs
Requires-Dist: xgboost>=2.0; extra == "fs"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# metaheuristicpy

A Python-based package of Metaheuristic Optimization Algorithms for Solving Continous and Discrete Optimization Problem

Version 3.3.0 aligns 15 algorithms with their papers after a source audit (see the Changelog). Version 3.2.0 added
a **unified continuous core** with 47 algorithms and the **Unified Binarization Framework (UBF)** that turns every one
of them into a wrapper feature-selection method. The legacy classes of 3.1.0 keep their API.

<hr>

## Package layout

| Module | Content |
|---|---|
| `metaheuristicpy.core` | Vectorised optimizer base (`Optimizer`: population, FE budget, global best, convergence history) and 47 algorithms (`ALGORITHMS`, `get_optimizer`) |
| `metaheuristicpy.continous.benchmark_math` | Legacy classes (AOA, EGO, EEGWO, GA, GCRA, GWO, IGWO, KMA, mGWO, PSOClassic, SMA, WaOA, WOA, MO) + every other core algorithm with the same `FUNCTIONS`/`solve()` API; classic formulas and CEC 2017/2020/2022 (`'cec2022_f1'`, via `opfunu`) |
| `metaheuristicpy.discrete.feature_selection` | Legacy binary classes + `UnifiedBinaryFS` and one `B<NAME>` class per core algorithm (e.g. `BPLO`, `BHHO`, `BGWO`) |

### Algorithms of the unified core

| Group | Acronyms (source of the implementation) |
|---|---|
| Official MATLAB/Python code (`_references/metaheuristic_codes`) | HHO, HGS, RUN, INFO, RIME, AO (Artemisinin), PO (Parrot), PLO, MGO, FATA, ECO, EGO |
| Established algorithms, paper equations | PSO, GA, GWO, MGWO, EEGWO, IGWO, WOA, SSA, SMA, AOA (Archimedes), GTO, GCRA, MO, KMA, WaOA |
| Hybrids / improved variants | SAR, EPO, PUMA, HGWODE, GWOWOA, PSOGWO, IAKMA, mEGO |
| Recent paper-only algorithms (2022-2025) | HO, HOA, FLA, PFA, APO, CFOA, CFO, BEO, MBKA, AHO, DIO, DRA |

Every class has a docstring with its reference. The 28 algorithms audited against their papers and official code
(GA, PSO, GWO, EEGWO, IGWO, MGWO, HGWODE, GWOWOA, WOA, WaOA, EGO, mEGO, HHO, GTO, HO, KMA, IAKMA, SMA, APO, MGO, AOA,
RIME, PLO, FATA, SAR, HOA, RUN, INFO) state `paper:` (with DOI), `official-code:` (what the official code does
differently, when it is followed), `deviation:` and `fixed in 3.3.0:`. The other classes mark known deviations inline
with `deviation:` / `simplified:`. Policy: coding errors are fixed to the paper; other choices of the official code
are kept and documented.

## Quick start

```python
from metaheuristicpy.core import get_optimizer
res = get_optimizer("PLO", n_agents=30, max_iter=300, seed=0).optimize(lambda x: (x ** 2).sum(), dim=10, lb=-100, ub=100)
res.best_fitness, res.history          # best value and best-so-far value per iteration

from metaheuristicpy.continous.benchmark_math import HHO
HHO(N_AGENTS=30, MAX_ITERATIONS=300, FUNCTIONS={"name": "cec2022_f6", "dimension": 10, "objective": "min"}).solve()

from metaheuristicpy.discrete.feature_selection import UnifiedBinaryFS, BPLO
fs = UnifiedBinaryFS("PLO", n_agents=20, max_iter=50, seed=0).fit(X_train, y_train)   # CV fitness on train only
X_train_sel, X_test_sel = fs.transform(X_train), fs.transform(X_test)
fs.summary()                           # selected features, fitness, real classifier fits, memo hits, time
BPLO(N_AGENTS=20, MAX_ITERATIONS=50).fit(X_tr, y_tr, X_val, y_val).solve()   # legacy-style API
```

## Unified Binarization Framework (UBF)

The continuous optimizer is untouched; the framework owns the mapping to feature subsets:

1. **Deterministic sign mapping** (default `transfer="sign"`) — feature *j* is selected when `x_j > 0`, so a position
   always gives the same subset and the optimizer sees a noise-free fitness. The stochastic transfer functions
   (S1-S4, V1-V4 and the time-varying sigmoid `tvs`) are still available. In our experiments only 15 of the 47
   algorithms beat random search with `tvs` (the 3.2.0 default), against 37 with the sign mapping (7 UCI datasets).
2. **Density-diverse initial population** (default `init="diverse"`) — agent *i* draws a target share
   `p_i ~ U(0.02, 0.98)` of selected features and `x = logit(p_i) + N(0, 1)`; uniform sampling only gives ~50% dense
   subsets. Algorithm-specific initialisations (e.g. the K-means centres of mEGO) are applied to these draws.
3. **Fitness memoisation** — identical masks are scored once.
4. **Elite bit-flip local search** — 10% of the FE budget on the final best mask.
5. **Random-search control** — `RS` / `BRS` spends the same budget on independent draws from the same sampler;
   an algorithm that does not beat it is not searching.

Fitness (minimised): `F(S) = 0.99·(1 − F1_macro(S)) + 0.01·|S|/D`, F1 from stratified 3-fold CV of KNN (k=5) on
the training split.

## Test report

```bash
python -m pytest tests -q                         # unit tests
python benchmarks/benchmark_cec2022.py            # CEC 2022, D=10
```

Result of 3.3.0 on Windows 11, Python 3.11.0, numpy 1.24.4, scikit-learn 1.2.1: **202 passed, 1 skipped in 16.5s**
(the skipped test is the CEC 2022 wrapper, which needs `opfunu`; 3.2.1 with opfunu 1.0.0: 113 passed).

| Test file | What is checked |
|---|---|
| `tests/test_core_continuous.py` | every one of the 47 algorithms (and the RS control) improves on a random point, stays inside the bounds, respects the FE budget, keeps a monotone best-so-far curve, is reproducible with a seed; maximisation, batch objectives, invalid arguments, legacy API and CEC 2022 wrapper |
| `tests/test_ubf_feature_selection.py` | UBF with the sign mapping (default), TV-sigmoid, S2 and V2 selects a non-empty subset that beats chance; the sign mapping is deterministic and the initial population covers sparse and dense subsets; the RS control runs; memo counters, validation-set mode, one `B<NAME>` class per algorithm, transfer-function ranges, argument validation |
| `tests/test_legacy_discrete.py` | regression of the `_initialize_agents` lower-bound fix; legacy binary classes still return a 0/1 subset |
| `tests/test_fixes_330.py` | every class has a docstring and the audited ones state their paper; one regression test per 3.3.0 fix (best-so-far GWO leaders, signed EEGWO term, KMA/SAR FE accounting, IAKMA variants, APO neighbours, FATA re-initialisation, AOA best object, MGO act probability, INFO WM2) |

### Continuous benchmark: CEC 2022 (F1-F12, D = 10)

> † = changed in 3.3.0 and re-run with 3.3.0 (16 parallel jobs); the other 32 algorithms are unchanged and keep
> their 3.2.1 runs (20 parallel jobs), so *Mean time / run* is not comparable between the two groups.
> This is a reduced budget, not the official CEC 2022 protocol (200,000 FEs and 30 runs for D = 10).

Setting: D = 10, 30 agents, 300 iterations (9,000 FEs), 10 independent runs (seeds 0-9), error = f(x_best) - f*.
Ranks are computed per function on the mean error (1 = best) and averaged over the 12 functions.
Raw runs: `benchmarks/results/cec2022_d10_raw.csv`; mean errors of all algorithms: `cec2022_d10_mean_error.csv`.

| Rank | Algorithm | Mean rank (F1-F12) | Wins | Mean time / run (s) |
|---:|---|---:|---:|---:|
| 1 | SAR † | 4.25 | 5 | 4.7 |
| 2 | APO † | 5.08 | 1 | 4.6 |
| 3 | PLO | 11.08 | 1 | 5.0 |
| 4 | MGO † | 11.08 | 0 | 3.7 |
| 5 | HGWODE | 11.50 | 1 | 6.3 |
| 6 | INFO † | 11.92 | 1 | 6.0 |
| 7 | CFOA | 12.00 | 0 | 7.0 |
| 8 | PUMA | 12.50 | 0 | 7.5 |
| 9 | RUN † | 13.42 | 1 | 6.2 |
| 10 | WaOA | 13.83 | 0 | 3.9 |
| 11 | SMA | 14.83 | 1 | 3.7 |
| 12 | DRA | 15.00 | 0 | 9.0 |
| 13 | RIME | 15.08 | 0 | 4.3 |
| 14 | GA | 15.17 | 0 | 4.8 |
| 15 | PSO | 15.75 | 0 | 3.7 |
| 16 | PFA | 15.83 | 0 | 6.4 |
| 17 | MGWO | 16.92 | 0 | 3.4 |
| 18 | BEO | 18.75 | 0 | 5.8 |
| 19 | FLA | 18.83 | 1 | 7.5 |
| 20 | GTO | 19.75 | 0 | 3.8 |
| 21 | HGS | 19.75 | 0 | 5.0 |
| 22 | SSA | 20.83 | 0 | 3.3 |
| 23 | PSOGWO † | 22.83 | 0 | 3.9 |
| 24 | HO † | 23.17 | 0 | 4.8 |
| 25 | DIO | 24.00 | 0 | 6.9 |
| 26 | FATA † | 24.08 | 0 | 3.9 |
| 27 | GWO † | 25.75 | 0 | 4.5 |
| 28 | AHO | 26.08 | 0 | 8.3 |
| 29 | IAKMA † | 26.08 | 0 | 5.2 |
| 30 | ECO | 26.33 | 0 | 7.9 |
| 31 | KMA † | 26.67 | 0 | 5.1 |
| 32 | PO | 27.67 | 0 | 4.6 |
| 33 | AOA † | 29.00 | 0 | 4.0 |
| 34 | CFO | 29.17 | 0 | 6.0 |
| 35 | GWOWOA † | 29.25 | 0 | 4.2 |
| 36 | MBKA | 29.75 | 0 | 7.7 |
| 37 | AO | 30.92 | 0 | 6.3 |
| 38 | IGWO † | 34.83 | 0 | 4.4 |
| 39 | HOA | 38.17 | 0 | 7.3 |
| 40 | EGO | 39.42 | 0 | 4.3 |
| 41 | mEGO | 40.00 | 0 | 7.7 |
| 42 | WOA | 40.08 | 0 | 3.4 |
| 43 | HHO | 41.17 | 0 | 4.4 |
| 44 | GCRA | 42.58 | 0 | 4.8 |
| 45 | MO | 44.92 | 0 | 6.8 |
| 46 | EEGWO † | 46.00 | 0 | 4.9 |
| 47 | EPO | 46.92 | 0 | 5.6 |

Mean error of the ten best-ranked algorithms:

| Algorithm | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| SAR | 3.95e-03 | 1.40e+00 | 3.45e-10 | 3.62e-01 | 5.92e-05 | 7.46e+02 | 3.34e+01 | 2.35e+01 | 3.69e+01 | 2.00e+02 | 1.48e-02 | 1.66e+02 |
| APO | 5.87e-02 | 1.67e+01 | 5.31e-10 | 2.10e-01 | 2.08e-04 | 4.99e+03 | 2.12e+01 | 1.78e+01 | 2.94e+02 | 2.00e+02 | 5.38e-01 | 1.66e+02 |
| PLO | 3.98e+02 | 7.03e+00 | 1.32e-04 | 1.69e-01 | 1.61e-01 | 1.33e+04 | 3.54e+01 | 5.03e+01 | 1.73e+02 | 2.07e+02 | 7.48e+00 | 1.67e+02 |
| MGO | 3.01e+01 | 7.75e+00 | 5.59e-03 | 2.96e-01 | 4.41e-02 | 4.24e+04 | 3.50e+01 | 2.40e+01 | 1.92e+02 | 2.02e+02 | 4.62e+00 | 1.67e+02 |
| HGWODE | 6.67e-04 | 2.12e+01 | 5.37e-10 | 3.72e-01 | 8.97e-03 | 2.92e+04 | 3.09e+01 | 2.58e+01 | 2.92e+02 | 2.12e+02 | 2.63e+02 | 1.66e+02 |
| INFO | 3.88e-12 | 4.57e+00 | 5.68e-14 | 4.28e-01 | 4.79e-01 | 5.87e+03 | 2.44e+01 | 6.10e+01 | 3.24e+02 | 2.59e+02 | 8.79e+01 | 1.67e+02 |
| CFOA | 3.05e+00 | 3.49e+00 | 2.50e-05 | 3.38e-01 | 7.82e-02 | 3.28e+04 | 3.57e+01 | 6.40e+01 | 3.89e+01 | 2.15e+02 | 3.26e-01 | 1.68e+02 |
| PUMA | 2.61e+01 | 9.85e+00 | 9.88e-07 | 7.65e-01 | 1.31e-02 | 2.13e+04 | 4.90e+01 | 2.87e+01 | 3.20e+02 | 2.01e+02 | 2.21e+00 | 1.66e+02 |
| RUN | 7.34e-04 | 1.16e+01 | 7.86e-09 | 1.90e-01 | 7.08e-01 | 1.60e+04 | 8.02e+01 | 6.61e+01 | 1.83e+02 | 2.69e+02 | 6.17e-03 | 1.68e+02 |
| WaOA | 1.11e+00 | 1.06e+01 | 2.41e-06 | 3.13e-01 | 2.90e-01 | 2.01e+04 | 3.79e+01 | 2.61e+01 | 2.24e+02 | 2.99e+02 | 9.28e-01 | 1.80e+02 |

Algorithms whose operators pull towards the origin (e.g. EEGWO, HHO, WOA, MO) reach 0 on the unshifted classic
functions but rank low on the shifted and rotated CEC suite; this is expected and is why CEC is reported.

### Discrete benchmark: feature selection on UCI datasets

Protocol: 8 UCI datasets (wine, wdbc, ionosphere, sonar, vehicle, dermatology, spectf, musk1), stratified 70/30 split,
min-max scaling fitted on train. The wrapper search uses only the training split (3-fold CV F1-macro of KNN, k=5,
fitness 0.99·(1−F1) + 0.01·|S|/D, 20 agents × 50 iterations = 1,000 FEs incl. 10% elite local search, UBF defaults:
sign mapping and density-diverse initialisation, 10 runs). The selected subset is scored on the untouched test split
with KNN, DT, SVM, MLP, RF and XGBoost. Baselines: all features, SelectKBest with ANOVA-F and with chi², k tuned by
the same CV on train, and the random-search control BRS (same budget, same sampler).

Table values are means over 8 datasets × 6 classifiers × 10 runs; *mean rank* is the Friedman rank of mean F1 per
(dataset, classifier) block. Friedman test over all methods: χ² = 174.9, p = 9.3e-16.

| Rank | Method | F1-macro | Accuracy | ROC-AUC | Selected features | Search time (s) | Mean rank |
|---:|---|---:|---:|---:|---:|---:|---:|
| 1 | AllFeatures | 0.8394 | 0.8701 | 0.9169 | 49.8 | 0.0 | 18.31 |
| 2 | BINFO | 0.8365 | 0.8652 | 0.9097 | 22.0 | 8.7 | 19.82 |
| 3 | BHOA | 0.8366 | 0.8675 | 0.9084 | 30.7 | 9.1 | 20.07 |
| 4 | BFATA | 0.8352 | 0.8655 | 0.9057 | 21.5 | 11.5 | 20.08 |
| 5 | BPFA | 0.8351 | 0.8650 | 0.9085 | 20.9 | 20.2 | 21.58 |
| 6 | BBEO | 0.8342 | 0.8647 | 0.9083 | 21.1 | 14.4 | 21.92 |
| 7 | BPLO | 0.8346 | 0.8648 | 0.9055 | 20.3 | 13.3 | 22.01 |
| 8 | BWaOA | 0.8331 | 0.8632 | 0.9041 | 23.3 | 15.8 | 22.40 |
| 9 | BGWOWOA | 0.8325 | 0.8628 | 0.9067 | 24.7 | 7.7 | 22.47 |
| 10 | BIAKMA | 0.8352 | 0.8656 | 0.9065 | 21.2 | 17.5 | 22.62 |
| 11 | BGA | 0.8336 | 0.8642 | 0.9069 | 24.5 | 12.9 | 22.79 |
| 12 | BKMA | 0.8361 | 0.8640 | 0.9095 | 19.5 | 16.6 | 22.81 |
| 13 | BIGWO | 0.8343 | 0.8636 | 0.9065 | 24.9 | 11.1 | 22.90 |
| 14 | BAHO | 0.8336 | 0.8645 | 0.9060 | 22.3 | 3.3 | 23.31 |
| 15 | BHO | 0.8329 | 0.8622 | 0.9057 | 16.2 | 13.6 | 23.77 |
| 16 | BPSO | 0.8327 | 0.8627 | 0.9072 | 22.0 | 13.3 | 23.94 |
| 17 | BHGWODE | 0.8336 | 0.8646 | 0.9046 | 21.8 | 11.2 | 24.00 |
| 18 | BEEGWO | 0.8348 | 0.8649 | 0.9113 | 26.9 | 4.7 | 24.17 |
| 19 | BAO | 0.8339 | 0.8633 | 0.9073 | 22.7 | 11.5 | 24.30 |
| 20 | BAPO | 0.8331 | 0.8633 | 0.9065 | 22.7 | 12.2 | 24.64 |
| 21 | BPUMA | 0.8335 | 0.8640 | 0.9062 | 21.1 | 15.1 | 24.67 |
| 22 | BmEGO | 0.8325 | 0.8635 | 0.9035 | 24.3 | 19.8 | 24.72 |
| 23 | BDIO | 0.8335 | 0.8632 | 0.9095 | 20.9 | 10.7 | 24.75 |
| 24 | BGWO | 0.8330 | 0.8648 | 0.9037 | 24.6 | 7.5 | 25.10 |
| 25 | BECO | 0.8314 | 0.8612 | 0.9056 | 19.0 | 5.8 | 26.00 |
| 26 | BAOA | 0.8329 | 0.8622 | 0.9082 | 21.5 | 23.0 | 26.16 |
| 27 | BMGWO | 0.8338 | 0.8631 | 0.9060 | 21.1 | 18.5 | 26.34 |
| 28 | BSAR | 0.8329 | 0.8621 | 0.9062 | 21.4 | 17.1 | 26.44 |
| 29 | BCFO | 0.8325 | 0.8628 | 0.9050 | 22.0 | 11.3 | 26.50 |
| 30 | BMBKA | 0.8319 | 0.8628 | 0.9054 | 21.4 | 9.3 | 26.73 |
| 31 | BCFOA | 0.8299 | 0.8594 | 0.9046 | 19.2 | 9.1 | 26.76 |
| 32 | BHGS | 0.8335 | 0.8635 | 0.9086 | 22.1 | 9.7 | 26.99 |
| 33 | BMO | 0.8328 | 0.8632 | 0.9050 | 22.4 | 6.3 | 27.05 |
| 34 | Chi2 | 0.8263 | 0.8579 | 0.9008 | 35.0 | 0.3 | 27.28 |
| 35 | BPO | 0.8318 | 0.8623 | 0.9044 | 20.3 | 14.1 | 27.35 |
| 36 | BPSOGWO | 0.8313 | 0.8630 | 0.9024 | 22.5 | 8.8 | 27.92 |
| 37 | BRUN | 0.8323 | 0.8622 | 0.9049 | 19.1 | 9.3 | 27.96 |
| 38 | BGCRA | 0.8325 | 0.8624 | 0.9067 | 23.4 | 3.8 | 28.17 |
| 39 | BDRA | 0.8312 | 0.8608 | 0.9038 | 20.7 | 8.8 | 28.23 |
| 40 | ANOVA | 0.8272 | 0.8591 | 0.9024 | 24.6 | 0.3 | 28.51 |
| 41 | BSSA | 0.8315 | 0.8625 | 0.9059 | 22.9 | 8.6 | 28.83 |
| 42 | BRIME | 0.8309 | 0.8608 | 0.9063 | 21.4 | 10.2 | 29.10 |
| 43 | BGTO | 0.8304 | 0.8612 | 0.9032 | 20.5 | 14.5 | 29.45 |
| 44 | BSMA | 0.8323 | 0.8620 | 0.9052 | 21.7 | 25.7 | 29.65 |
| 45 | BFLA | 0.8297 | 0.8597 | 0.9033 | 20.9 | 9.1 | 30.17 |
| 46 | BMGO | 0.8289 | 0.8590 | 0.9002 | 19.0 | 14.5 | 30.40 |
| 47 | BEGO | 0.8291 | 0.8600 | 0.9015 | 22.9 | 18.1 | 30.54 |
| 48 | BHHO | 0.8296 | 0.8604 | 0.9056 | 20.0 | 3.5 | 31.02 |
| 49 | BRS (random-search control) | 0.8297 | 0.8603 | 0.9048 | 18.1 | 16.1 | 31.42 |
| 50 | BWOA | 0.8287 | 0.8595 | 0.9044 | 22.3 | 4.3 | 31.49 |
| 51 | BEPO | 0.8172 | 0.8479 | 0.8922 | 11.4 | 6.3 | 42.40 |

Reading:

- **Search vs random search** (best fitness before the local search, 80 paired runs, Wilcoxon + Holm):
  38 of 47 algorithms reach a significantly better fitness than BRS; BECO, BAHO, BGCRA, BMO, BHOA, BHHO, BWOA, BEPO, BEEGWO do not.
  `benchmarks/results/fs_uci_search_vs_random.csv`.
- **Test split.** The best-ranked wrappers (BINFO, BHOA, BFATA) are significantly better than BRS on test F1
  (Holm p = 0.007, 0.036 and 0.023, in that order). BINFO keeps the F1 of the full
  feature set within 0.3 points with 55% fewer
  features and has a higher mean F1 than the ANOVA-F and chi² filters, but these differences against the filters
  and against all features are **not** significant after Holm correction (p ≥ 0.88),
  and the top three wrappers are not significantly different from each other.
  `benchmarks/results/fs_uci_wilcoxon_best.csv`, `fs_uci_wilcoxon_top_group.csv`.
- **Ablation** (BINFO and BHOA, one component changed at a time, paired Wilcoxon on test F1): a stochastic transfer
  function instead of the sign mapping lowers F1 by 0.35-0.54 points (significant only for BHOA with the TV-sigmoid,
  p = 0.042 uncorrected); memoisation leaves the result unchanged and makes the search 2.5-2.9x faster (57-59% of
  the FEs come from the memo); the density-diverse initialisation and the elite local search have no significant
  effect on test F1. `benchmarks/results/fs_uci_ablation.csv`, `fs_uci_ablation_wilcoxon.csv`.

Full study (one notebook per algorithm, convergence plots, ROC curves, confusion matrices, ablation of the UBF
components): research repository `#17-binarymetaheuristic_for_fs`.

## Changelog

- **3.3.0** — source audit of 28 algorithms against their papers and official code (textbook *Dari Serigala
  hingga Komodo*). Behaviour changes:
  GWO, EEGWO, IGWO, GWO-WOA and PSOGWO take alpha/beta/delta from the best solutions found so far (the paper's rule);
  EEGWO uses (X' - X) in Eq. (7) instead of |X' - X|; GWO-WOA restores the factor Y of Eq. (26);
  AOA keeps the best object found so far; KMA produces two offspring when mating, applies survivor selection to big
  males and none to small males; IAKMA implements IKMA-1 / IKMA-2 of the paper (`variant=1|2`);
  APO uses the paper's neighbours instead of (i +- k) mod N; SAR runs one phase per human and iteration with SE = 0.4;
  RUN tries x_new3 only when x_new2 was rejected; HO derives T from 3N FEs per iteration.
  Coding errors of the official code fixed to the paper: INFO WM2 weight (best - worst), MGO P(act = 1) = 0.15,
  FATA uniform re-initialisation. Every class has a docstring; new `tests/test_fixes_330.py`.
  Results obtained with these 15 algorithms under 3.2.1 are not reproducible with 3.3.0.
- **3.2.1** — UBF defaults changed to the deterministic sign mapping and the density-diverse initialisation
  (with the 3.2.0 default, the stochastic time-varying sigmoid, only 15 of the 47 algorithms beat random search;
  with the sign mapping 37 do); new random-search control `RS` / `BRS`; `Optimizer.optimize(..., sampler=)` and `Optimizer.sample(n)`.
  Fix: a problem sampler replaced algorithm-specific initialisations, so under UBF mEGO behaved exactly like EGO.
- **3.2.0** — unified core (47 algorithms), UBF feature selection, CEC 2017/2020/2022 support, pytest suite.
  Fix: `BaseMetaheuristics._initialize_agents` read the lower bound from `UB`, so every initial position of the
  legacy discrete classes was 1.0.
- 3.1.0 and earlier — legacy continuous and discrete classes.

<hr>

# Cite

If you think this package is useful, please cite this paper in your project: <br>
[1] Bimantara, I.M.S., Sanjaya ER, N., Purwitasari, D. (2023). Character Entity Recognition Using Hybrid Binary-Particle Swarm Optimization and Conditional Random Field on Balinese Folklore Text. In: Delir Haghighi, P., et al. Information Integration and Web Intelligence. iiWAS 2023. Lecture Notes in Computer Science, vol 14416. Springer, Cham. https://doi.org/10.1007/978-3-031-48316-5_15 <br>
[2] Bimantara, I. M. S., & Widiartha, I. M. (2023). Optimization of K-Means Clustering Using Particle Swarm Optimization Algorithm for Grouping Traveler Reviews Data on Tripadvisor Sites. Jurnal Ilmiah Kursor, 12(1), 1-10. <br>
[3] Supriana, I. W., Raharja, M. A., Bimantara, I. M. S., & Bramantya, D. (2021). Implementasi dua model crossover pada algoritma genetika untuk optimasi penggunaan ruang perkuliahan. Jurnal RESISTOR (Rekayasa Sistem Komputer), 4(2), 167-177. <br>
[4] BIMANTARA, I Made Satria et al. Implementasi Generalized Learning Vector Quantization (GLVQ) dan Particle Swarm Optimization (PSO) Untuk Klasifikasi Kanker Payudara. JELIKU (Jurnal Elektronik Ilmu Komputer Udayana), [S.l.], v. 10, n. 4, p. 307-318, may 2022. ISSN 2654-5101. Available at: <https://ojs.unud.ac.id/index.php/jlk/article/view/85746>. Date accessed: 31 may 2025. doi: https://doi.org/10.24843/JLK.2022.v10.i04.p01. <br>

# Contributors and Developer

- I Made Satria Bimantara
- email: satriabimantara.idm@gmail.com
