Extending the relevant component analysis algorithm for metric learning using both positive and negative equivalence constraints