| As a common indicator of surface water monitoring,CODMn(permanganate index),is determined by chemical reagent in the current national standard.The method has obvious advantages but has many defects such as long time of Sample Reflux heating,easy to secondary pollution and complex operation.The spectrum of water sample can be measured by spectrometer,and the relationship between the spectrum and CODMn can be obtained by quantitative analysis.However,the composition of water is too complex,so it is very difficult to analyze the correspondence between components and spectra one by one.Machine learning theory and model is a typical black box system,which can extract the recurring rules and patterns from a large number of phenomena.Therefore,based on the spectral data of water samples measured by UV visible spectrometer and CODMn test data,this paper focuses on the process of constructing the prediction model of CODMn by XGBoost algorithm,BP neural network and its optimization algorithm GA.The emphasis of the thesis can be summarized as follows:(1)The spectral data characteristics of water samples were analyzed and data preprocessing was carried out.According to the characteristics of high dimension of the collected spectral data of water samples,the thesis uses principal component dimension reduction method to reduce the 1297 dimensions absorbance information contained in the spectral data and obtains 8 main components,which greatly reduces the dimension of absorbance data;According to the general requirements of machine learning data set construction,the data set is divided reasonably,which lays the data foundation for the construction of machine learning model.(2)Build and train the XGBoost prediction model.According to the characteristics of the XGBoost algorithm,the Grid Search method was used to optimize the parameters,then the XGBoost prediction model is built and trained.After the Test Set was imported,the prediction results are analyzed.The results show that the model has a good fit degree of 0.90 and the prediction performance of CODMn is good;(3)Build and train GA-BP prediction model.The paper studies the principle of BP neural network and its optimization algorithm GA,analyzes the method of determining the number,weight and threshold of neurons in each layer of BP neural network,then builds a three-layer GA BP neural network prediction model and trains well.After the Test Set was imported,the prediction results are analyzed.The results show that the model has a good fit degree of 0.95 and the prediction performance of CODMn is very good.This thesis can provide mentality and technical reference for the construction of ecological civilization and the technological innovation of water quality monitoring. |