jmetalpy


Namejmetalpy JSON
Version 1.7.0 PyPI version JSON
download
home_pagehttps://github.com/jMetal/jMetalPy
SummaryPython version of the jMetal framework
upload_time2024-06-21 07:54:15
maintainerAntonio J. Nebro, Antonio Benitez-Hidalgo
docs_urlNone
authorAntonio J. Nebro
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![jMetalPy](docs/source/jmetalpy.png)

[![CI](https://github.com/jMetal/jMetalPy/actions/workflows/ci.yml/badge.svg)](https://github.com/jMetal/jMetalPy/actions/workflows/ci.yml)
[![PyPI Python version](https://img.shields.io/pypi/pyversions/jMetalPy.svg)]()
[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.swevo.2019.100598-blue)](https://doi.org/10.1016/j.swevo.2019.100598)
[![PyPI License](https://img.shields.io/pypi/l/jMetalPy.svg)]()
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

A paper introducing jMetalPy is available at: https://doi.org/10.1016/j.swevo.2019.100598

### Table of Contents
- [Installation](#installation)
- [Usage](#hello-world-)
- [Features](#features)
- [Changelog](#changelog)
- [License](#license)

## Installation

You can install the latest version of jMetalPy with `pip`, 

```console
pip install jmetalpy  # or "jmetalpy[distributed]"
```

<details><summary><b>Notes on installing with <tt>pip</tt></b></summary>
<p>

jMetalPy includes features for parallel and distributed computing based on [pySpark](https://spark.apache.org/docs/latest/api/python/index.html) and [Dask](https://dask.org/).

These (extra) dependencies are *not* automatically installed when running `pip`, which only comprises the core functionality of the framework (enough for most users):

```console
pip install jmetalpy
```

This is the equivalent of running: 

```console
pip install "jmetalpy[core]"
```

Other supported commands are listed next:

```console
pip install "jmetalpy[dev]"  # Install requirements for development
pip install "jmetalpy[distributed]"  # Install requirements for parallel/distributed computing
pip install "jmetalpy[complete]"  # Install all requirements
```

</p>
</details>

## Hello, world! 👋

Examples of configuring and running all the included algorithms are located [in the documentation](https://jmetal.github.io/jMetalPy/multiobjective.algorithms.html).

```python
from jmetal.algorithm.multiobjective import NSGAII
from jmetal.operator import SBXCrossover, PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.termination_criterion import StoppingByEvaluations

problem = ZDT1()

algorithm = NSGAII(
    problem=problem,
    population_size=100,
    offspring_population_size=100,
    mutation=PolynomialMutation(probability=1.0 / problem.number_of_variables(), distribution_index=20),
    crossover=SBXCrossover(probability=1.0, distribution_index=20),
    termination_criterion=StoppingByEvaluations(max_evaluations=25000)
)

algorithm.run()
```

We can then proceed to explore the results:

```python
from jmetal.util.solution import get_non_dominated_solutions, print_function_values_to_file,
    print_variables_to_file

front = get_non_dominated_solutions(algorithm.result())

# save to files
print_function_values_to_file(front, 'FUN.NSGAII.ZDT1')
print_variables_to_file(front, 'VAR.NSGAII.ZDT1')
```

Or visualize the Pareto front approximation produced by the algorithm:

```python
from jmetal.lab.visualization import Plot

plot_front = Plot(title='Pareto front approximation', axis_labels=['x', 'y'])
plot_front.plot(front, label='NSGAII-ZDT1', filename='NSGAII-ZDT1', format='png')
```

<img src=docs/source/_static/NSGAII-ZDT1.png width=450 alt="Pareto front approximation">

## Features
The current release of jMetalPy (v1.7.0) contains the following components:

* Algorithms: local search, genetic algorithm, evolution strategy, simulated annealing, random search, NSGA-II, NSGA-III, SMPSO, OMOPSO, MOEA/D, MOEA/D-DRA, MOEA/D-IEpsilon, GDE3, SPEA2, HYPE, IBEA. Preference articulation-based algorithms (G-NSGA-II, G-GDE3, G-SPEA2, SMPSO/RP); Dynamic versions of NSGA-II, SMPSO, and GDE3.
* Parallel computing based on Apache Spark and Dask.
* Benchmark problems: ZDT1-6, DTLZ1-2, FDA, LZ09, LIR-CMOP, RWA, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).
* Encodings: real, binary, permutations.
* Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random).
* Quality indicators: hypervolume, additive epsilon, GD, IGD.
* Pareto front approximation plotting in real-time, static or interactive.
* Experiment class for performing studies either alone or alongside [jMetal](https://github.com/jMetal/jMetal).
* Pairwise and multiple hypothesis testing for statistical analysis, including several frequentist and Bayesian testing methods, critical distance plots and posterior diagrams.

| ![Scatter plot 2D](docs/source/_static/2D.gif) | ![Scatter plot 3D](docs/source/_static/3D.gif) |
|-------------- | ----------------  |
| ![Parallel coordinates](docs/source/_static/p-c.gif) | ![Interactive chord plot](docs/source/_static/chordplot.gif) |

## Changelog

* [v1.7.0] Add RWA benchmark, refactor classes BinarySolution and BinaryProblem.
* [v1.6.0] Refactor class Problem, the single-objective genetic algorithm can solve constrained problems, performance improvements in NSGA-II, generation of Latex tables summarizing the results of the Wilcoxon rank sum test, added a notebook folder with examples.
* [v1.5.7] Use of linters for catching errors and formatters to fix style, minor bug fixes.
* [v1.5.6] Removed warnings when using Python 3.8.
* [v1.5.5] Minor bug fixes.
* [v1.5.4] Refactored quality indicators to accept numpy array as input parameter.
* [v1.5.4] Added [CompositeSolution](https://github.com/jMetal/jMetalPy/blob/master/jmetal/core/solution.py#L111) class to support mixed combinatorial problems. [#69](https://github.com/jMetal/jMetalPy/issues/69)

## License

This project is licensed under the terms of the MIT - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jMetal/jMetalPy",
    "name": "jmetalpy",
    "maintainer": "Antonio J. Nebro, Antonio Benitez-Hidalgo",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "antonio@lcc.uma.es, antonio.benitez@lcc.uma.es",
    "keywords": null,
    "author": "Antonio J. Nebro",
    "author_email": "antonio@lcc.uma.es",
    "download_url": "https://files.pythonhosted.org/packages/77/89/b145f7c18cfdff57920f2937d73e6cb9738daf4b77e2ca4df821768212d7/jmetalpy-1.7.0.tar.gz",
    "platform": null,
    "description": "![jMetalPy](docs/source/jmetalpy.png)\n\n[![CI](https://github.com/jMetal/jMetalPy/actions/workflows/ci.yml/badge.svg)](https://github.com/jMetal/jMetalPy/actions/workflows/ci.yml)\n[![PyPI Python version](https://img.shields.io/pypi/pyversions/jMetalPy.svg)]()\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.swevo.2019.100598-blue)](https://doi.org/10.1016/j.swevo.2019.100598)\n[![PyPI License](https://img.shields.io/pypi/l/jMetalPy.svg)]()\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA paper introducing jMetalPy is available at: https://doi.org/10.1016/j.swevo.2019.100598\n\n### Table of Contents\n- [Installation](#installation)\n- [Usage](#hello-world-)\n- [Features](#features)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Installation\n\nYou can install the latest version of jMetalPy with `pip`, \n\n```console\npip install jmetalpy  # or \"jmetalpy[distributed]\"\n```\n\n<details><summary><b>Notes on installing with <tt>pip</tt></b></summary>\n<p>\n\njMetalPy includes features for parallel and distributed computing based on [pySpark](https://spark.apache.org/docs/latest/api/python/index.html) and [Dask](https://dask.org/).\n\nThese (extra) dependencies are *not* automatically installed when running `pip`, which only comprises the core functionality of the framework (enough for most users):\n\n```console\npip install jmetalpy\n```\n\nThis is the equivalent of running: \n\n```console\npip install \"jmetalpy[core]\"\n```\n\nOther supported commands are listed next:\n\n```console\npip install \"jmetalpy[dev]\"  # Install requirements for development\npip install \"jmetalpy[distributed]\"  # Install requirements for parallel/distributed computing\npip install \"jmetalpy[complete]\"  # Install all requirements\n```\n\n</p>\n</details>\n\n## Hello, world! \ud83d\udc4b\n\nExamples of configuring and running all the included algorithms are located [in the documentation](https://jmetal.github.io/jMetalPy/multiobjective.algorithms.html).\n\n```python\nfrom jmetal.algorithm.multiobjective import NSGAII\nfrom jmetal.operator import SBXCrossover, PolynomialMutation\nfrom jmetal.problem import ZDT1\nfrom jmetal.util.termination_criterion import StoppingByEvaluations\n\nproblem = ZDT1()\n\nalgorithm = NSGAII(\n    problem=problem,\n    population_size=100,\n    offspring_population_size=100,\n    mutation=PolynomialMutation(probability=1.0 / problem.number_of_variables(), distribution_index=20),\n    crossover=SBXCrossover(probability=1.0, distribution_index=20),\n    termination_criterion=StoppingByEvaluations(max_evaluations=25000)\n)\n\nalgorithm.run()\n```\n\nWe can then proceed to explore the results:\n\n```python\nfrom jmetal.util.solution import get_non_dominated_solutions, print_function_values_to_file,\n    print_variables_to_file\n\nfront = get_non_dominated_solutions(algorithm.result())\n\n# save to files\nprint_function_values_to_file(front, 'FUN.NSGAII.ZDT1')\nprint_variables_to_file(front, 'VAR.NSGAII.ZDT1')\n```\n\nOr visualize the Pareto front approximation produced by the algorithm:\n\n```python\nfrom jmetal.lab.visualization import Plot\n\nplot_front = Plot(title='Pareto front approximation', axis_labels=['x', 'y'])\nplot_front.plot(front, label='NSGAII-ZDT1', filename='NSGAII-ZDT1', format='png')\n```\n\n<img src=docs/source/_static/NSGAII-ZDT1.png width=450 alt=\"Pareto front approximation\">\n\n## Features\nThe current release of jMetalPy (v1.7.0) contains the following components:\n\n* Algorithms: local search, genetic algorithm, evolution strategy, simulated annealing, random search, NSGA-II, NSGA-III, SMPSO, OMOPSO, MOEA/D, MOEA/D-DRA, MOEA/D-IEpsilon, GDE3, SPEA2, HYPE, IBEA. Preference articulation-based algorithms (G-NSGA-II, G-GDE3, G-SPEA2, SMPSO/RP); Dynamic versions of NSGA-II, SMPSO, and GDE3.\n* Parallel computing based on Apache Spark and Dask.\n* Benchmark problems: ZDT1-6, DTLZ1-2, FDA, LZ09, LIR-CMOP, RWA, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).\n* Encodings: real, binary, permutations.\n* Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random).\n* Quality indicators: hypervolume, additive epsilon, GD, IGD.\n* Pareto front approximation plotting in real-time, static or interactive.\n* Experiment class for performing studies either alone or alongside [jMetal](https://github.com/jMetal/jMetal).\n* Pairwise and multiple hypothesis testing for statistical analysis, including several frequentist and Bayesian testing methods, critical distance plots and posterior diagrams.\n\n| ![Scatter plot 2D](docs/source/_static/2D.gif) | ![Scatter plot 3D](docs/source/_static/3D.gif) |\n|-------------- | ----------------  |\n| ![Parallel coordinates](docs/source/_static/p-c.gif) | ![Interactive chord plot](docs/source/_static/chordplot.gif) |\n\n## Changelog\n\n* [v1.7.0] Add RWA benchmark, refactor classes BinarySolution and BinaryProblem.\n* [v1.6.0] Refactor class Problem, the single-objective genetic algorithm can solve constrained problems, performance improvements in NSGA-II, generation of Latex tables summarizing the results of the Wilcoxon rank sum test, added a notebook folder with examples.\n* [v1.5.7] Use of linters for catching errors and formatters to fix style, minor bug fixes.\n* [v1.5.6] Removed warnings when using Python 3.8.\n* [v1.5.5] Minor bug fixes.\n* [v1.5.4] Refactored quality indicators to accept numpy array as input parameter.\n* [v1.5.4] Added [CompositeSolution](https://github.com/jMetal/jMetalPy/blob/master/jmetal/core/solution.py#L111) class to support mixed combinatorial problems. [#69](https://github.com/jMetal/jMetalPy/issues/69)\n\n## License\n\nThis project is licensed under the terms of the MIT - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python version of the jMetal framework",
    "version": "1.7.0",
    "project_urls": {
        "Homepage": "https://github.com/jMetal/jMetalPy",
        "Source": "https://github.com/jMetal/jMetalPy",
        "Tracker": "https://github.com/jMetal/jMetalPy/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b9e8861e8b105cda1a3e96eea787dbe2fe75a957a9a77f51a22b371d5d6981bb",
                "md5": "63e7078784b94a4c83e77e73715ef914",
                "sha256": "57a86bb939695459b0f7deb4723abbbdf4c28fb83bf8036cfdaf20b17b6778e9"
            },
            "downloads": -1,
            "filename": "jmetalpy-1.7.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63e7078784b94a4c83e77e73715ef914",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 216505,
            "upload_time": "2024-06-21T07:54:10",
            "upload_time_iso_8601": "2024-06-21T07:54:10.228984Z",
            "url": "https://files.pythonhosted.org/packages/b9/e8/861e8b105cda1a3e96eea787dbe2fe75a957a9a77f51a22b371d5d6981bb/jmetalpy-1.7.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7789b145f7c18cfdff57920f2937d73e6cb9738daf4b77e2ca4df821768212d7",
                "md5": "ed3087183ec2272da3a0d50f314035db",
                "sha256": "0229a073b1a98117b55d210ac0487f5d5dc048f5659d55b84ae94d8431a8e4ad"
            },
            "downloads": -1,
            "filename": "jmetalpy-1.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ed3087183ec2272da3a0d50f314035db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 130076,
            "upload_time": "2024-06-21T07:54:15",
            "upload_time_iso_8601": "2024-06-21T07:54:15.495687Z",
            "url": "https://files.pythonhosted.org/packages/77/89/b145f7c18cfdff57920f2937d73e6cb9738daf4b77e2ca4df821768212d7/jmetalpy-1.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-21 07:54:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jMetal",
    "github_project": "jMetalPy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jmetalpy"
}
        
Elapsed time: 0.49289s