Metric learning revisited new approaches for supervised and unsupervised metric learning with analysis and algorithms