Giter Club home page Giter Club logo

paretoset's People

Contributors

kartiksubbarao avatar tommyod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

paretoset's Issues

SystemError: initialization of _internal failed without raising an exception


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

ParetoSet object

Collection of solutions where elements can be added sequentially.

max comparisons break if sense includes diff comparisons

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:

if not diff_cols:
# Its an array
if not isinstance(costs, np.ndarray):
costs = costs.to_numpy(copy=True)
for col in max_cols:
costs[:, col] = -costs[:, col]
return paretoset_algorithm(costs, distinct=distinct)

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.

How should I cite your work?

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

update pre-existing paretoset

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.