Spectroscopy is an important component analysis method and full spectrum prediction method may be complicated and inaccurate. In order to find out the irrelevant variables, a variable selection method based on the frequent pattern tree(FP-tree) is proposed in this paper. The proposed method firstly formulates an orthogonal array to generate wavelength selection plans, which makes the wavelength selection more reasonable. Then, partial least square(PLS) is performed on the spectral data which is selected by the orthogonal array, and the root-mean-square error of cross validation is adopted as the evaluation criteria of the performances of each prediction model. Based on the results of the evaluation, A set of data which contains the wavelength selection of these model whose performance are evaluated as good can be got. The support count of each wavelength is determined according to the data set and the infrequent wavelengths are discarded while frequent wavelengths are sorted in decreasing support counts. After this, an FP-tree is built based on processed data set. The final selection result is a branch in FP-tree which has the maximum number of sum frequent count. The prediction model is built based on the selection result by PLS. The full spectrum PLS, the uninformative variable elimination with the PLS method and the proposed method are conducted on a real spectral data set of flue gas, the effectiveness of these methods are compared and discussed. The experimental results show that the proposed method is more accurate and has presentable compression performance.