moocore provides fast implementations of core mathematical functions and algorithms for multi-objective optimization. While available in R, this entry focuses on the Python package (v0.2.0). It offers functionalities for generating and transforming non-dominated sets, identifying dominated vectors, and computing various quality metrics like hypervolume and epsilon indicator. The critical functionality is implemented in C for high performance. The project maintains a frequent release cadence, often with minor updates.
pip install moocoreVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic usage of moocore for identifying and filtering non-dominated points and calculating the hypervolume indicator. It assumes a minimization problem for all objectives. The `moocore.is_nondominated` function returns a boolean mask, while `moocore.filter_dominated` directly returns the non-dominated points. The `moocore.Hypervolume` class is initialized with a reference point and then called with the set of points.
Thoroughly test `moocore`'s output against your established benchmarks or reference implementations, especially for edge cases or when high numerical precision is paramount. Consult the documentation for algorithm specifics.
Ensure your C/C++ compiler is up-to-date if building from source. For installed versions, check GitHub issues for updates on C-core error handling. Isolate `moocore` calls in `try-except` blocks to handle potential exceptions, though abrupt termination may still bypass this for some unhandled C-level errors.
Always convert input data to `numpy` arrays before passing them to `moocore` functions, e.g., `data = np.asarray(your_list_of_points)`. Explicitly install `numpy` in your environment (`pip install numpy`).
Review the full changelog on GitHub, examine the `git diff` between versions if possible, and run comprehensive regression tests on your code when upgrading from any 0.1.x version to 0.2.0 or newer.
Ensure you have successfully installed the package using pip: `pip install moocore`. If installed in a virtual environment, activate it before running your script. Verify installation with `pip show moocore`.
Install the required C/C++ build tools for your operating system. For Windows, install 'Build Tools for Visual Studio'. For Linux, install 'build-essential' (e.g., `sudo apt-get install build-essential`). For macOS, install 'Xcode Command Line Tools' (`xcode-select --install`). After installing, try `pip install moocore` again. Alternatively, install a pre-compiled wheel if available for your system and Python version.
Consult the `moocore` documentation or use `dir(moocore)` in a Python interpreter to find the correct attribute or function name. The correct function for hypervolume is likely `moocore.hypervolume()` or a method on a specific class within `moocore`.
Review the documentation for the specific `moocore` function you are using to understand its expected input array shapes and dimensions. Ensure your input data (e.g., objective values, reference points) conforms to these requirements, often involving reshaping NumPy arrays (e.g., using `.reshape(-1, num_objectives)` or ensuring correct initial array creation).