distanceTypeToJson function
Implementation
String distanceTypeToJson(Distance distance) {
switch (distance) {
case Distance.cosine:
return cosineDistanceTypeEncodedValue;
case Distance.hamming:
return hammingDistanceTypeEncodedValue;
case Distance.euclidean:
return euclideanDistanceTypeEncodedValue;
case Distance.manhattan:
return manhattanDistanceTypeEncodedValue;
default:
throw UnsupportedError('Unsupported distance type $distance');
}
}