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

New delta function has fix_symmetry set to "False" #2

Closed
andbue opened this issue Sep 25, 2017 · 3 comments
Closed

New delta function has fix_symmetry set to "False" #2

andbue opened this issue Sep 25, 2017 · 3 comments

Comments

@andbue
Copy link

andbue commented Sep 25, 2017

If a new CompositeDeltaFunction is created, its fix_symmetry-attribute is for some reason set to "False".
Is this the expected behaviour?

@thvitt
Copy link

thvitt commented Sep 27, 2017

I don't quite get your question … fix_symmetry is a property of MetricDeltaFunction (which encapsulates a distance metric like those from scikit-learn), and it is only used in MetricDeltaFunction's __call__ method. CompositeDeltaFunction simply delegates to an existing (possibly Metric) DeltaFunction.

(In other words: Could you provide a problematic test case?)

@thvitt
Copy link

thvitt commented Sep 30, 2017

I still can't reproduce this. Here's a test:

def composite_metric_test(self):
mcosine = d.MetricDeltaFunction('cosine', 'mcosine')
assert mcosine.fix_symmetry == True, "fix_symmetry is False!?"
mcd = d.CompositeDeltaFunction('mcosine-z_score', 'metric_cosine_delta')
assert mcd.basis.fix_symmetry == True, "basis.fix_symmetry is False!?"
self.check_function(d.functions.metric_cosine_delta, 0.6156353166442046)

@andbue
Copy link
Author

andbue commented Oct 1, 2017

Sorry, after restarting my jupyter kernel it works as expected. Must have been my own code's fault.
Thanks for looking into this issue anyway!

@andbue andbue closed this as completed Oct 1, 2017
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

2 participants