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 computation #162

Open
vferat opened this issue Feb 16, 2024 · 0 comments
Open

Distance computation #162

vferat opened this issue Feb 16, 2024 · 0 comments

Comments

@vferat
Copy link
Owner

vferat commented Feb 16, 2024

The distance between two vectors should be a linear function

_distance_matrix should be changed from

def _distance_matrix(X, Y=None):
    """Distance matrix used in metrics."""
    distances = np.abs(1 / np.corrcoef(X, Y)) - 1
    distances = np.nan_to_num(
        distances, copy=False, nan=10e300, posinf=1e300, neginf=-1e300
    )
    return distances

to

def _distance_matrix(X, Y=None):
    """Distance matrix used in metrics."""
    distances = 1 - np.abs(1 / np.corrcoef(X, Y))
    return distances
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

Successfully merging a pull request may close this issue.

1 participant