RokIvansek / attribute-interactions

A python implementation of attribute interactions. An Orange add-on (scripting part only).
2 stars 0 forks source link

Getting the indices of n maximum values in a 2D array #17

Closed RokIvansek closed 8 years ago

RokIvansek commented 8 years ago

So instead of keeping a list of Interaction objects, keep just the interaction_matrix. This will save space. When you want the best interactions in a form of an Interaction object, get the indices of the maximum values in the interaction_matrix and compute the Interaction object by using attribute_interactions method.

http://stackoverflow.com/questions/10337533/a-fast-way-to-find-the-largest-n-elements-in-an-numpy-array http://stackoverflow.com/questions/9482550/argmax-of-numpy-array-returning-non-flat-indices http://stackoverflow.com/questions/5807047/pythonnumpy-efficient-way-to-take-the-min-max-n-values-and-indices-from-a-matr

RokIvansek commented 8 years ago

Done. Removed the internal list. the library is now generating Interaction objects only when necessary. They are never stored internaly.