We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sometimes both, strong positive and strong negative correlations are meaningful, so we should allow for that.
One way to do this is to add a boolean absolute_value argument to pairwise_cosine
absolute_value
pairwise_cosine
copairs/src/copairs/compute.py
Lines 65 to 69 in c10c93e
def pairwise_cosine(x_sample: np.ndarray, y_sample: np.ndarray, absolute_value: bool = False) -> np.ndarray: x_norm = x_sample / np.linalg.norm(x_sample, axis=1)[:, np.newaxis] y_norm = y_sample / np.linalg.norm(y_sample, axis=1)[:, np.newaxis] c_sim = np.sum(x_norm * y_norm, axis=1) if absolute_value: c_sim = np.abs(c_sim) return c_sim
The text was updated successfully, but these errors were encountered:
Is that reasonable?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Sometimes both, strong positive and strong negative correlations are meaningful, so we should allow for that.
One way to do this is to add a boolean
absolute_value
argument topairwise_cosine
copairs/src/copairs/compute.py
Lines 65 to 69 in c10c93e
The text was updated successfully, but these errors were encountered: