Skip to content

Commit

Permalink
change filtering threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
maim02 committed Jan 17, 2024
1 parent feb907b commit aac5fac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spectrum_fundamentals/metrics/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def spectral_angle(
observed_intensities = observed_intensities.multiply(boolean_array).toarray()
predicted_intensities = predicted_intensities.multiply(boolean_array).toarray()

predicted_non_zero_mask = predicted_intensities > constants.EPSILON
predicted_non_zero_mask = predicted_intensities > 0.04

if isinstance(observed_intensities, scipy.sparse.csr_matrix):
observed_masked = observed_intensities.multiply(predicted_non_zero_mask)
Expand All @@ -91,7 +91,7 @@ def spectral_angle(
observed_normalized = SimilarityMetrics.unit_normalization(observed_masked)
predicted_normalized = SimilarityMetrics.unit_normalization(predicted_masked)

observed_non_zero_mask = observed_intensities > constants.EPSILON
observed_non_zero_mask = observed_intensities > 0.04
fragments_in_common = SimilarityMetrics.rowwise_dot_product(observed_non_zero_mask, predicted_non_zero_mask)

dot_product = SimilarityMetrics.rowwise_dot_product(observed_normalized, predicted_normalized) * (
Expand Down

0 comments on commit aac5fac

Please sign in to comment.