tommyod / paretoset Goto Github PK
View Code? Open in Web Editor NEWCompute the Pareto (non-dominated) set, i.e., skyline operator/query.
License: MIT License
Compute the Pareto (non-dominated) set, i.e., skyline operator/query.
License: MIT License
Hi, I use your library in my thesis. How should I cite your software?
Really good work, I love how easy it is to use!
Best,
Clemens
For an optimisation problem I need to instantiate a paretoset and keep it up to date when new data comes in
With the current implementation my workflow looks like the following
from paretoset import paretoset
import pandas as pd
my_set = pd.DataFrame(columns=["A", "B"])
for bunch in new_data_iterator:
candidates = pd.concat(my_set, bunch, axis=0)
idxs = paretoset(candidates, ["min", "max"])
my_set = candidates[idxs]
The problem with the current implem is that the paretoset
method returns a boolean mask. We cannot keep a mask up to date.
Is there any way of doing better ?
Collection of solutions where elements can be added sequentially.
SystemError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from paretoset import paretoset
2 import pandas as pd
4 hotels = pd.DataFrame({"price": [50, 53, 62, 87, 83, 39, 60, 44],
5 "distance_to_beach": [13, 21, 19, 13, 5, 22, 22, 25]})
File ~\anaconda3\lib\site-packages\paretoset_init_.py:13
10 author = "tommyod"
12 import sys
---> 13 from paretoset.user_interface import paretoset, paretorank
14 from paretoset.algorithms_numpy import crowding_distance
17 def run_tests():
File ~\anaconda3\lib\site-packages\paretoset\user_interface.py:9
4 from paretoset.utils import user_has_package, validate_inputs
7 import pandas as pd
----> 9 if user_has_package("numba"):
10 from paretoset.algorithms_numba import BNL
13 def paretoset(costs, sense=None, distinct=True, use_numba=True):
File ~\anaconda3\lib\site-packages\paretoset\utils.py:9, in user_has_package(package_name)
7 """Check if the user has numba
installed."""
8 try:
----> 9 importlib.import_module(package_name, package=None)
10 return True
11 except ModuleNotFoundError:
File ~\anaconda3\lib\importlib_init_.py:127, in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
File ~\anaconda3\lib\site-packages\numba_init_.py:42
38 from numba.core.decorators import (cfunc, generated_jit, jit, njit, stencil,
39 jit_module)
41 # Re-export vectorize decorators and the thread layer querying function
---> 42 from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
43 get_num_threads, set_num_threads,
44 set_parallel_chunksize, get_parallel_chunksize,
45 get_thread_id)
47 # Re-export Numpy helpers
48 from numba.np.numpy_support import carray, farray, from_dtype
File ~\anaconda3\lib\site-packages\numba\np\ufunc_init_.py:3
1 # -- coding: utf-8 --
----> 3 from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
4 from numba.np.ufunc._internal import PyUFunc_None, PyUFunc_Zero, PyUFunc_One
5 from numba.np.ufunc import _internal, array_exprs
File ~\anaconda3\lib\site-packages\numba\np\ufunc\decorators.py:3
1 import inspect
----> 3 from numba.np.ufunc import _internal
4 from numba.np.ufunc.parallel import ParallelUFuncBuilder, ParallelGUFuncBuilder
6 from numba.core.registry import DelayedRegistry
SystemError: initialization of _internal failed without raising an exception
Anyone wanna grab this task? Let me know!
Nice entry to make a first time PR on the library!
If the sense
parameter to paretoset()
includes a diff comparsion, all other max comparisons return the opposite of the correct value. Example:
In [10]: paretoset([[2,0], [1,0], [0,1]], ['max', 'diff'])
Out[10]: array([False, True, True])
This cause appears to be in this section:
paretoset/paretoset/user_interface.py
Lines 94 to 101 in 0c01636
The loop to invert the sign of the max_cols
columns is only executed if there are no diff_cols
. If diff columns are present, this loop is skipped.
"On Finding the Maxima of a Set of Vectors"
Maybe this can speed up computations
Might be nice to have.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.