Abstract Nearest feature line is an effective classification algorithm. However, if a test sample cannot be linear represented by the training samples, the algorithm may not work very well. Moreover, another problem is that it will have a large computation complexity. Therefore, the authors propose a novel algorithm. To begin with, the test sample is linear represented by all the training samples, and the errors between the test sample and every training sample are calculated. The authors only keep the training samples with small errors. In this way, on the one hand, training samples are not suitable for the test sample will be ignored, on the other hand, running time can be reduced. To further reduce the computing time of the algorithm, ne...