Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assumption of sorting data for sklearn agents is too strong. #31

Open
maffettone opened this issue Dec 13, 2023 · 0 comments
Open

Assumption of sorting data for sklearn agents is too strong. #31

maffettone opened this issue Dec 13, 2023 · 0 comments
Assignees

Comments

@maffettone
Copy link
Contributor

Decomposition general preforms stronger and appears more intuitive if the data is sorted. The current assumptions for DecompositionAgentBase
and [for ClusterAgentBase] will also only work for 1-d independent data.

Expected Behavior

  • Work for n-d independent vars
  • Potentially don't sort for clustering?

Current Behavior

Sorting higher dims causes value errors.

Possible Solution

partial solution for 2D that needs extension:

try:
    sorted_independents, sorted_observables = zip(
        *sorted(zip(self.independent_cache, self.observable_cache))
    )
except ValueError:
    # Multidimensional case
    sorted_independents, sorted_observables = zip(
        *sorted(zip(self.independent_cache, self.observable_cache), key=lambda x: (x[0][0], x[0][1]))
    )
@maffettone maffettone self-assigned this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant