Near-infrared spectroscopy(NIR) was employed to determine the quality of walnut oil. Multivariate scattering correction(MSC) and combination of standard normal variate and de-trend(SNV-DT) were separately used for preprocessing. Successive projection algorithm(SPA) and combination of competitive adaptive reweighted sampling algorithm and partial least squares method(CARS-PLS) were separately used for extraction of characteristic wavelengths. Particle swarm optimization(PSO) and genetic algorithm(GA) methods were separately used fo...