This paper discusses the problem of improving the efficiency of metric machine learning methods of identification attacks in vehicular adhoc networks (VANETs). The main idea of this research is to select the type of nonlinear functions for calculating the distances between the objects of the sample, describing the traffic of VANET using metric methods, such as the method of k-nearest neighbour with linearly decreasing weights and the Parzen window method. The analysis of the effectiveness of the methods considered was carried out on a synthetically generated sample with three different types of attacks on the network. Computational experiments have shown that the k-nearest neighbour method with decreasing weights based on an exponential function with base a < 1 is more efficient than the Parzen window method by about 0.3% and has an accuracy of 84.15%.