A Novel Distance Metric Based on Differential Evolution

  • Ömer Faruk ErtuğrulEmail author
Research Article - Computer Engineering and Computer Science


Distance has been employed as a representation of similarity for half a century. Many different distance metrics have been proposed in this duration such as Euclidean, Manhattan, Minkowski and weighted Euclidean distance metrics. Each of them has its own characteristics and is calculated in different formulations/manners. In this paper, a novel distance metric, which has a high adaptation capability, was proposed. In order to increase the adaptation ability of the proposed distance metric, its parameters were optimized according to the employed dataset by differential evolution (DE), which is a metaheuristic optimization method. The proposed distance metric was employed in the k-nearest neighbor, and 30 different benchmark datasets were used in the evaluation of the proposed approach. Each of the parameters of the novel distance metric and the parameters of DE was assessed based on the obtained accuracies. Obtained results validated the applicability of the proposed distance metric and the proposed approach.


Distance metric k-nearest neighbor Differential evaluation Parameter optimization 


Compliance with Ethical Standards

Conflict of interest

The author declares that he has no conflict of interest.

Ethical Approval

This article does not contain any studies with human participants or animals performed by any of the authors.


  1. 1.
    Cover, T.; Hart, P.: Nearest neighbor pattern classification. IEEE Trans. Inf. Theory 13(1), 21–27 (1967)CrossRefzbMATHGoogle Scholar
  2. 2.
    Goldstein, M.: kn-Nearest neighbor classification. IEEE Trans. Inf. Theory IT-18(5), 627–630 (1972)CrossRefzbMATHGoogle Scholar
  3. 3.
    Adeniyi, D.A.; Wei, Z.; Yongquan, Y.: Automated web usage data mining and recommendation system using K-nearest neighbor (KNN) classification method. Appl. Comput. Inform. 12(1), 90–108 (2016)CrossRefGoogle Scholar
  4. 4.
    Song, Y.; Liang, J.; Lu, J.; Zhao, X.: An efficient instance selection algorithm for k nearest neighbor regression. Neurocomputing 251, 26–34 (2017)CrossRefGoogle Scholar
  5. 5.
    Denoeux, T.; Kanjanatarakul, O.; Sriboonchitta, S.: EK-NNclus: a clustering procedure based on the evidential K-nearest neighbor rule. Knowl. Based Syst. 88, 57–69 (2015)CrossRefGoogle Scholar
  6. 6.
    Mohammed, M.A.; Ghani, M.K.A.; Hamed, R.I.; Mostafa, S.A.; Ibrahim, D.A.; Jameel, H.K.; Alallah, A.H.: Solving vehicle routing problem by using improved K-nearest neighbor algorithm for best solution. J. Comput. Sci. 21, 232–240 (2017)CrossRefGoogle Scholar
  7. 7.
    Chen, G.H.; Shah, D.: Explaining the success of nearest neighbor methods in prediction. Found. Trends® Mach. Learn. 10(5–6), 337–588 (2018)CrossRefzbMATHGoogle Scholar
  8. 8.
    Guo, Y.; Han, S.; Li, Y.; Zhang, C.; Bai, Y.: K-nearest neighbor combined with guided filter for hyperspectral image classification. Procedia Comput. Sci. 129, 159–165 (2018)CrossRefGoogle Scholar
  9. 9.
    Joshi, A.; Mehta, A.: Analysis of K-nearest neighbor technique for breast cancer disease classification. Mach. Learn. 98, 13 (2018)Google Scholar
  10. 10.
    Wan, C.H.; Lee, L.H.; Rajkumar, R.; Isa, D.: A hybrid text classification approach with low dependency on parameter by integrating K-nearest neighbor and support vector machine. Expert Syst. Appl. 39(15), 11880–11888 (2012)CrossRefGoogle Scholar
  11. 11.
    Zhang, M.L.; Zhou, Z.H.: A k-nearest neighbor based algorithm for multi-label classification. IEEE Int. Conf. Granul. Comput. 2, 718–721 (2005)Google Scholar
  12. 12.
    Beyer K; Goldstein J; Ramakrishnan R; Shaft U: When is “nearest neighbor” meaningful? In: International Conference on Database Theory, pp. 217–235 (1999)Google Scholar
  13. 13.
    Ertuğrul, Ö.F.; Tağluk, M.E.: A novel version of k nearest neighbor: dependent nearest neighbor. Appl. Soft Comput. 55, 480–490 (2017)CrossRefGoogle Scholar
  14. 14.
    Triguero, I.; García, S.; Herrera, F.: Differential evolution (DE) for optimizing the positioning of prototypes in nearest neighbor classification. Pattern Recogn. 44(4), 901–916 (2011)CrossRefGoogle Scholar
  15. 15.
    Kaur, M.; Kumar, V.: Adaptive differential evolution-based Lorenz chaotic system for image encryption. Arab. J. Sci. Eng. 43(12), 8127–8144 (2018)CrossRefGoogle Scholar
  16. 16.
    Price, K.V.; Storn, R.: Differential evolution: a simple evolution strategy for fast optimization. Dr. Dobb’s J. 22(4), 18–24 (1997)zbMATHGoogle Scholar
  17. 17.
    Storn, R.; Price, K.V.: Differential evolution: a simple and efficient adaptive scheme for global optimization over continuous spaces. International Computer Science Institute (ICSI), USA, Technical Report TR-95-012.∼storn/litera.html (2015)
  18. 18.
    Wang, L.; Hu, H.; Ai, X.Y.; Liu, H.: Effective electricity energy consumption forecasting using echo state network improved by differential evolution algorithm. Energy 153, 801–815 (2018)CrossRefGoogle Scholar
  19. 19.
    Wu, G.; Shen, X.; Li, H.; Chen, H.; Lin, A.; Suganthan, P.N.: Ensemble of differential evolution variants. Inf. Sci. 423, 172–186 (2018)MathSciNetCrossRefGoogle Scholar
  20. 20.
    BoussaïD, I.; Lepagnot, J.; Siarry, P.: A survey on optimization metaheuristics. Inf. Sci. 237, 82–117 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
  21. 21.
    Das, S.; Suganthan, P.N.: Differential evolution: a survey of the state-of-the-art. IEEE Trans. Evol. Comput. 15(1), 4–31 (2011)CrossRefGoogle Scholar
  22. 22.
    Lu, X.F.; Tang, K.: Classification- and regression-assisted differential evolution for computationally expensive problems. J. Comput. Sci. Technol. 27(5), 1024–1034 (2012)MathSciNetCrossRefGoogle Scholar
  23. 23.
    Omran, M.G.; Engelbrecht, A.P.; Salman, A.: Differential evolution methods for unsupervised image classification. In: The 2005 IEEE Congress on Evolutionary Computation, vol. 2, pp. 966–973 (2005)Google Scholar
  24. 24.
    Zeng, Y.R.; Zeng, Y.; Choi, B.; Wang, L.: Multifactor-influenced energy consumption forecasting using enhanced back-propagation neural network. Energy 127, 381–396 (2017)CrossRefGoogle Scholar
  25. 25.
    Pham, H.A.: Reduction of function evaluation in differential evolution using nearest neighbor comparison. Vietnam J. Comput. Sci. 2(2), 121–131 (2015)CrossRefGoogle Scholar
  26. 26.
    Dash, C.S.K.; Saran, A.; Sahoo, P.; Dehuri, S.; Cho, S.B.: Design of self-adaptive and equilibrium differential evolution optimized radial basis function neural network classifier for imputed database. Pattern Recogn. Lett. 80, 76–83 (2016)CrossRefGoogle Scholar
  27. 27.
    Boriah, S.; Chandola, V.; Kumar, V.: Similarity measures for categorical data: a comparative evaluation. Red 30(2), 243–254 (2008)Google Scholar
  28. 28.
    Cha, S.H.: Comprehensive survey on distance/similarity measures between probability density functions. Int. J. Math. Models Methods Appl. Sci. 1(4), 300–3007 (2007)Google Scholar
  29. 29.
    Hand, D.J.; Vinciotti, V.: Choosing k for two-class nearest neighbour classifiers with unbalanced classes. Pattern Recogn. Lett. 24(9), 1555–1562 (2003)CrossRefzbMATHGoogle Scholar
  30. 30.
    Jiang, Q.; Jin, X.; Lee, S.J.; Yao, S.: A new similarity/distance measure between intuitionistic fuzzy sets based on the transformed isosceles triangles and its applications to pattern recognition. Expert Syst. Appl. 116, 439–453 (2019)CrossRefGoogle Scholar
  31. 31.
    Ozcan, K.; Velipasalar, S.; Varshney, P.K.: Autonomous fall detection with wearable cameras by using relative entropy distance measure. IEEE Trans. Hum. Mach. Syst. 47(1), 31–39 (2017)Google Scholar
  32. 32.
    Peng, J.; Heisterkamp, D.R.; Dai, H.K.: Adaptive quasiconformal kernel nearest neighbor classification. IEEE Trans. Pattern Anal. Mach. Intell. 26(5), 656–661 (2004)CrossRefGoogle Scholar
  33. 33.
    Yu, K.; Ji, L.; Zhang, X.: Kernel nearest-neighbor algorithm. Neural Process. Lett. 15(2), 147–156 (2002)CrossRefzbMATHGoogle Scholar
  34. 34.
    Zuo, W.; Zhang, D.; Wang, K.: On kernel difference-weighted k-nearest neighbor classification. Pattern Anal. Appl. 11(3–4), 247–257 (2008)MathSciNetCrossRefGoogle Scholar
  35. 35.
    Chernoff, K.; Nielsen, M.: Weighting of the k-nearest-neighbors. In: IEEE 20th International Conference on Pattern Recognition (ICPR), pp. 666–669 (2010)Google Scholar
  36. 36.
    Dudani, S.A.: The distance-weighted k-nearest-neighbor rule. IEEE Trans. Syst. Man Cybern. 4, 325–327 (1976)CrossRefGoogle Scholar
  37. 37.
    García-Pedrajas, N.; del Castillo, J.A.R.; Cerruela-García, G.: A proposal for local k values for k-nearest neighbor rule. IEEE Trans. Neural Netw. Learn. Syst. 28(2), 470–475 (2017)CrossRefGoogle Scholar
  38. 38.
    Hechenbichler, K.; Schliep, K.: Weighted k-nearest-neighbor techniques and ordinal classification. Sonderforschungsbereich 386, Paper 399 (2004)Google Scholar
  39. 39.
    MacLeod, J.E.; Luk, A.; Titterington, D.M.: A re-examination of the distance-weighted k-nearest neighbor classification rule. IEEE Trans. Syst. Man Cybern. 17(4), 689–696 (1987)CrossRefGoogle Scholar
  40. 40.
    Duin, R.P.W.; Juszczak, P.; Paclik P.; Pekalska E.; de Ridder D.: PR-Tools 4.0, a Matlab Toolbox for Pattern Recognition, The Netherlands (2004)Google Scholar
  41. 41.
    Lichman, M.: UCI machine learning repository., Irvine, CA University, California, School of Computing and Information Sciences
  42. 42.
    Ertuğrul, Ö.F.: A novel type of activation function in artificial neural networks: trained activation function. Neural Netw. 99, 148–157 (2018)CrossRefGoogle Scholar
  43. 43.
    Bajpai, A.; Varshney, U.; Dubey, D: Performance enhancement of automatic speech recognition system using euclidean distance comparison and artificial neural network. In: 3rd International Conference On Internet of Things: Smart Innovation and Usages (IoT-SIU), pp. 1–5. IEEE (2018)Google Scholar
  44. 44.
    Pambudi, E.A.; Andono, P.N.; Pramunendar, R.A.: Image segmentation analysis based on K-means PSO by using three distance measures. ICTACT J. Image Video Process. 9(1), 1821–1826 (2018)Google Scholar
  45. 45.
    Thompson, A.C.: Minkowski Geometry. Cambridge University Press, Cambridge (1996)CrossRefzbMATHGoogle Scholar
  46. 46.
    Zhang, W.; Hua, X.; Yu, K.; Qiu, W.; Zhang, S.; He, X.: A novel WiFi indoor positioning strategy based on weighted squared Euclidean distance and local principal gradient direction. Sens. Rev. (2018). Google Scholar
  47. 47.
    Peng, L.; Liu, S.; Liu, R.; Wang, L.: Effective long short-term memory with differential evolution algorithm for electricity price prediction. Energy 162, 1301–1314 (2018)CrossRefGoogle Scholar
  48. 48.
    Price, K.; Storn, R.; Lampinen, J.: Differential Evolution—A Practical Approach to Global Optimization. Springer, Berlin (2005)zbMATHGoogle Scholar
  49. 49.
    Sanam, J.; Ganguly, S.; Panda, A.K.; Hemanth, C.: Optimization of energy loss cost of distribution networks with the optimal placement and sizing of DSTATCOM using differential evolution algorithm. Arab. J. Sci. Eng. 42(7), 2851–2865 (2017)CrossRefGoogle Scholar

Copyright information

© King Fahd University of Petroleum & Minerals 2019

Authors and Affiliations

  1. 1.Department of Electrical and Electronics EngineeringBatman UniversityBatmanTurkey

Personalised recommendations