Skip to main content

Python library for pareto front extraction

Project description

# pypareto Pypareto is a Python library for pareto front seaching. ## Usage ComparisonChain.split_by_pareto performs the pareto front split fronts.

Currently this works only for unique rows. You can add id as the last row (and not sort by it) to work around this restriction.

Here the None means just inferior value:

>>> values = [(0,None,None), (2,2,2), (0,1,1), (0,0,1), (None,0,1), (0,1,0), (None,1,1), (1,0,0), (0,0,0)]
>>> chain = Comparison(by_value, MaxMinList(MaxMin.MAX, MaxMin.MAX, MaxMin.MAX)).as_chain()
>>> chain.split_by_pareto(values)
[[(2, 2, 2)], [(0, 1, 1), (1, 0, 0)], [(0, 0, 1), (0, 1, 0), (None, 1, 1)], [(None, 0, 1), (0, 0, 0)], [(0, None, None)]]

Here one extra None means that the whole row is inferior:

>>> values = [(0,None,None), (2,2,2), (0,1,1), (0,0,1), (None,0,1), (0,1,0), (None,1,1), (1,0,0), (0,0,0), (None, 0, None)]
>>> chain = GroupNones(MaxMinList(MaxMin.MIN, MaxMin.MIN, MaxMin.MIN)).and_then(
...    Comparison(by_value, MaxMinList(MaxMin.MAX, MaxMin.MAX, MaxMin.MAX)))
>>> chain.split_by_pareto(values)
[[(2, 2, 2)], [(0, 1, 1), (1, 0, 0)], [(0, 0, 1), (0, 1, 0)], [(0, 0, 0)], [(None, 1, 1)], [(None, 0, 1)], [(0, None, None), (None, 0, None)]]

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pypareto-0.3.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pypareto-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pypareto-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pypareto-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 192dd8c5eecc4f11a872406a47982acec7d8e881318903886aad65498ab8aa65
MD5 ff806a569ceb8d88b9cf0023f0e953d2
BLAKE2b-256 43d3a33747a865f853ade2f64a9abba43f9e77a9ca2642999a52b73eaf412345

See more details on using hashes here.

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