Code for Random Forest models that predict pharmaceutical and water chemistry measurements in Baltimore Ecosystem Study streams
收藏资源简介:
This file contains code to model the relationship between the water chemistry measurements and discharge measured as part of BES routine sampling and the pharmaceuticals measured in WY 2018. We use Random Forest models to predict 1) total (i.e., summed) concentration of the pharmaceuticals for which we screened, 2) total nutrient concentrations (TN & TP), 3) whether or not the antibiotic trimethoprim was detected in a given sample, and 4) whether or not nitrate and TP were above or below environmentally-relevant threshold concentrations. We also use RF models to predict N and P concentrations over a longer period, in order to compare models for nutrients to pharma. Code and analyses here rely on data processed in the file "BESPharma_WY2018.Rmd", published on EDI (doi:10.6073/pasta/610cb67fcbc8982c2af8ed946dce8ea5) and BES water chemistry data published on EDI (doi:10.6073/pasta/ce7f30e6013e003bfe28c5fd7d4aed23 )
本文件包含用于构建水质化学测量值、BES常规采样获取的径流量与2018水文年(WY 2018)检测的药物类污染物浓度之间关联关系的模型代码。本研究采用随机森林(Random Forest)模型开展四项预测任务:1)本研究筛查覆盖的药物类污染物总(即求和)浓度;2)总营养盐浓度(总氮Total Nitrogen, TN、总磷Total Phosphorus, TP);3)给定水样中是否检出抗生素甲氧苄啶(trimethoprim);4)硝酸盐与总磷浓度是否符合环境相关阈值浓度要求。此外,为对比营养盐模型与药物类污染物模型的性能,本研究还通过随机森林模型对更长时间序列内的氮、磷浓度进行预测。本文所用代码与分析均依赖于文件"BESPharma_WY2018.Rmd"中处理得到的数据,该数据集及BES水质化学数据均发布于环境数据倡议(EDI)平台,对应DOI分别为10.6073/pasta/610cb67fcbc8982c2af8ed946dce8ea5与10.6073/pasta/ce7f30e6013e003bfe28c5fd7d4aed23。



