Skip to main content

Binary Cosmic Evolution Algorithm for optimization problems

Project description

Binary Cosmic Evolution Optimization (B-CEO)

Test & Publish PyPI version Python Version License: MIT

A Python package for multi-objective feature selection using a novel binarized version of the Cosmic Evolution Optimization (CEO) algorithm.

This package is designed to find optimal feature subsets that maximize classification accuracy while simultaneously minimizing the number of selected features.

📖 Background: The Problem

In machine learning, the "Curse of Dimensionality" refers to the problems that arise when dealing with high-dimensional data (datasets with many features). High feature counts can lead to model overfitting, slow training times, and poor generalization.

Feature selection is the process of identifying the most relevant subset of features to build a model, improving performance and reducing complexity. Metaheuristic algorithms are particularly well-suited for this, as they can efficiently explore the vast, complex search space of all possible feature combinations.

[cite_start]This package adapts the Cosmic Evolution Optimization (CEO) algorithm, a powerful physics-based metaheuristic[cite: 4], for this binary optimization task.

🚀 What is BinaryCEO?

This package implements a unique "True-CEO" binarization strategy that remains faithful to the core mathematics of the original paper:

  1. Continuous Internal State: Each solution ("celestial body") maintains a continuous vector (continuous_position) that represents its propensity or "probabilistic momentum" for each feature.
  2. Physics-Based Updates: This continuous vector is updated using the paper's original physics-based forces:
    • Local Gravitation (Exploitation): A pull toward the local system's leader.
    • Global Gravitation (Exploitation): An adaptive pull toward the global best solution.
    • Cosmic Expansion (Exploration): A decaying random "jump" to explore the search space.
  3. Probabilistic Translation: A Sigmoid function translates the continuous vector (e.g., [-2.2, 1.5, 0.1]) into a probability vector (e.g., [0.1, 0.8, 0.5]).
  4. Stochastic Binarization: A "weighted coin flip" based on these probabilities generates the final binary solution ([0, 1, 1]) to be evaluated.

This approach uses the paper's "natural brake" (where forces weaken as continuous positions converge) and avoids the need for an artificial inertia weight w common in other binarization methods like Binary PSO.

Key Features

  • Multi-Objective Fitness: Balances classification accuracy and feature count using a single, weighted objective function.
  • Modular Design: Written with a clean, modular structure (Initialization, Partitioning, Update, Selection).
  • Local Search: Implements the paper's "Celestial Resonance" as a binary bit-flip local search to refine elite solutions.
  • Robust Testing: Type-checked with mypy and unit-tested with pytest.

📦 Installation

You can install BinaryCEO directly from PyPI:

pip install binaryceo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binaryceo-0.1.0.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binaryceo-0.1.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file binaryceo-0.1.0.tar.gz.

File metadata

  • Download URL: binaryceo-0.1.0.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for binaryceo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28ba1fa89deb14dc1a346fbe5ccccf0eff76c3a8f3c17b1a8bb4ca8146a00874
MD5 7b9ab0cfa69b9d1f5b8a874010951ee7
BLAKE2b-256 4e0485aebbb752960f56f3691873f78e67ea1f6c37d2f988e6cb2020e939dd70

See more details on using hashes here.

Provenance

The following attestation bundles were made for binaryceo-0.1.0.tar.gz:

Publisher: publish.yml on Optimization-MetaheuristicsCEO/BinaryCEO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file binaryceo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: binaryceo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for binaryceo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b39eece0b7bd942ccbab51ff19fa3b5f0973607b8cf900a9d92fae881ce47d6b
MD5 c013f4f58f633535344b7982d04b6a0f
BLAKE2b-256 37ef3046ebe987d365f7228946373d7de6c4d8806609de7fc0aeb556694986cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for binaryceo-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Optimization-MetaheuristicsCEO/BinaryCEO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page