Return the enumeration constant associated with a KMeans distance metric string.
var str2enum = require( '@stdlib/ml/base/cluster/kmeans/metric-str2enum' );Returns the enumeration constant associated with a KMeans distance metric string.
var v = str2enum( 'cosine' );
// returns <number>If unable to resolve an enumeration constant, the function returns null.
var v = str2enum( 'beep' );
// returns null- Downstream consumers of this function should not rely on specific integer values (e.g.,
SQEUCLIDEAN == 0). Instead, the function should be used in an opaque manner.
var str2enum = require( '@stdlib/ml/base/cluster/kmeans/metric-str2enum' );
var v = str2enum( 'cosine' );
// returns <number>
v = str2enum( 'sqeuclidean' );
// returns <number>