Varieties of raisins are diverse, and different varieties have different nutritional properties and commercial value. In this paper, we propose a method to identify different varieties of raisins by combining near-infrared (NIR) spectroscopy and machine learning algorithms. The direct averaging of the spectra taken for each sample may reduce the experimental data and affect the extraction of spectral features, thus limiting the classification results, due to the different substances of grape skins and flesh. Therefore, this experiment proposes a method to fuse the spectral features of pulp and peel. In this experiment, principal component analysis (PCA) was used to extract baseline corrected features, and linear models of k-nearest neighbor (KNN) and linear discriminant analysis (LDA) and nonlinear models of back propagation (BP), support vector machine with genetic algorithm (GA-SVM), grid search-support vector machine (GS-SVM) and particle swarm optimization with support vector machine (PSO- SVM) coupling were used to classify. This paper compared the results of four experiments using only skin spectrum, only flesh spectrum, average spectrum of skin and flesh, and their spectral feature fusion. The experimental results showed that the accuracy and Macro-F1 score after spectral feature fusion were higher than the other three experiments, and GS-SVM had the highest accuracy and Macro-F1 score of 94.44%. The results showed that feature fusion can improve the performance of both linear and nonlinear models. This may provide a new strategy for acquiring spectral data and improving model performance in the future. The code is available at https://github.com/L-ain/Source.