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

Distance Metrics #1331

Open
alanlujan91 opened this issue Aug 4, 2023 · 11 comments
Open

Distance Metrics #1331

alanlujan91 opened this issue Aug 4, 2023 · 11 comments

Comments

@alanlujan91
Copy link
Member

We need to make it much more transparent how we are comparing the distances between our solutions and solution objects. Currently the way to do it is very labyrinthian and to figure it out you have to know how to follow a long rabbit hole.

We should be able to specify clearly what the distance criteria is and the user should be able to understand how that is happening readily.

@llorracc

@mnwhite
Copy link
Contributor

mnwhite commented Aug 4, 2023 via email

@llorracc
Copy link
Collaborator

llorracc commented Aug 7, 2023 via email

@mnwhite
Copy link
Contributor

mnwhite commented Aug 7, 2023 via email

@Mv77
Copy link
Contributor

Mv77 commented Aug 8, 2023

Just to chime in: I am a big fan of how we compute distances. In particular, I love the fact that the distance function is recursive (maybe that makes it confusing?). We are handling complex objects and I find the recursive distance solution clever and pythonic in that it is object-oriented and uses class inheritances.

The distance metric definition for consumer solutions in IndShockConsumer is the first line in their class definitions

distance_criteria = ["vPfunc"]

Maybe, as @mnwhite says this is just an advertisement and documentation issue? It might be good to have metrics feature more prominently in the docs, and also print what object is being compared by the solve method?

If we wanted to flexibilize it, a way could be to let objects have a list of properties that could plausibly be used in the distance metric (e.g., [vPFunc, vFunc, MNrmStE]) and then have the solver receive an optional parameter indicating what subset of those to use, with reasonable defaults.

@alanlujan91
Copy link
Member Author

I think one compromise is that we can define the class method in-place to overwrite the default recursive look up.

class ConsumerSolution(MetricObject):

    ....
    def distance(self, other):
        return custom_distance

This should overwrite the default case when implemented.

@mnwhite
Copy link
Contributor

mnwhite commented Aug 8, 2023 via email

@llorracc
Copy link
Collaborator

llorracc commented Aug 8, 2023 via email

@mnwhite
Copy link
Contributor

mnwhite commented Aug 8, 2023 via email

@llorracc
Copy link
Collaborator

llorracc commented Aug 8, 2023 via email

@mnwhite
Copy link
Contributor

mnwhite commented Aug 8, 2023 via email

@llorracc
Copy link
Collaborator

llorracc commented Aug 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants