peaks-similarity
Version:
Peaks similarity - calculate the similarity between 2 ordered arrays of peaks
38 lines (34 loc) • 874 B
JavaScript
import { test, expect } from 'vitest';
import { Comparator } from '..';
test('similarity with itself should be 1', () => {
const comparator = new Comparator();
const data = [
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
];
const result = comparator.getSimilarity(data, data);
expect(result.similarity).toBe(1);
});