public static < D > ScoreAssociation < D > scoreEuclidean ( Class < D > tupleType , boolean squared ) { if ( TupleDesc_F64 . class . isAssignableFrom ( tupleType ) ) { if ( squared ) return ( ScoreAssociation ) new ScoreAssociateEuclideanSq_F64 ( ) ; else return ( ScoreAssociation ) new ScoreAssociateEuclidean_F64 ( ) ; } else if ( tupleType == TupleDesc_F32 . class ) { if ( squared ) return ( ScoreAssociation ) new ScoreAssociateEuclideanSq_F32 ( ) ; } throw new IllegalArgumentException ( "Euclidean score not yet supported for type " + tupleType . getSimpleName ( ) ) ; }
Scores features based on the Euclidean distance between them . The square is often used instead of the Euclidean distance since it is much faster to compute .