cramer library

Cramer's Distance

The Cramer Distance is a measure of dissimilarity between two distributions and is calculated by taking the square root of the sum of the squared differences between the two distributions.

Example:

import 'package:fhe_similarity_score/cramer.dart';

void main() {
 print(distance([0.1, 0.2, 0.7], [0.1, 0.2, 0.7])); // 0
 print(distance([0.1, 0.2, 0.7], [0.2, 0.3, 0.5])); // 0.24494897427831777
}

Functions

distance(List<double> p, List<double> q) double
Cramer Distance
distanceOfCiphertextVecDouble(Afhe fhe, List<Ciphertext> x, List<double> y) List<Ciphertext>
Cramer Distance for encrypted list of doubles