Metric learning, one of the main topics of machine learning, is used to approximate similar data and to increase the distance between unrelated data in an existing space. With aiming the best solution for today's problems, setting a good metric for this would have a positive impact on performance. It has been benefited from a transformation matrix in metric learning. When we examine the studies in the literature, it is seen that the metric learning is based on positive definite matrix (PSD). The study is not dependent on positive definite matrices. Initially, brute force approach is investigated for all possible transformation matrices with in a data set with two features in randomly generated data sets. After successful results, it is benefited from the genetic algorithm to obtain both better representation space and faster solution using Parkinson speech data. As a result of applying the proposed method on a real dataset; The success rate has increased from 59.71% to 67.79%.