{'fraction_non_alphanumeric': 0.02900461437046803, 'fraction_numerical': 0.017798286090969017, 'mean_word_length': 5.096385542168675, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Prediction of Heavy Metal Concentrations in Contaminated Sites from Portable X-ray Fluorescence Spectrometer Data Using Machine Learning

Portable X-ray fluorescence (pXRF) spectrometers provide simple, rapid, nondestructive, and cost-effective analysis of the metal contents in soils. The current method for improving pXRF measurement accuracy is soil sample preparation, which inevitably consumes significant amounts of time. To eliminate the influence of sample preparation on PXRF measurements, this study evaluates the performance of pXRF measurements in the prediction of eight heavy metals’ contents through machine learning algorithm linear regression (LR) and multivariate adaptive regression spline (MARS) models. Soil samples were collected from five industrial sites and separated into high-value and low-value datasets with pXRF measurements above or below the background values. The results showed that for Cu and Cr, the MARS models were better than the LR models at prediction (the MARS-R2 values were 0.88 and 0.78; the MARS-RPD values were 2.89 and 2.11). For the pXRF low-value dataset, the multivariate MARS models improved the pXRF measurement accuracy, with the R2 values improved from 0.032 to 0.39 and the RPD values increased by 0.02 to 0.37. For the pXRF high-value dataset, the univariate MARS models predicted the content of Cu and Cr with less calculation. Our study reveals that machine learning methods can better predict the Cu and Cr of large samples from multiple contaminated sites.