目的 以桂枝茯苓胶囊（Guizhi Fuling Capsules，GFC）和天舒胶囊（Tianshu Capsule，TC）为研究对象，将近红外光谱（near-infrared spectroscopy，NIRS）技术与机器学习算法结合，建立快速检测2种制剂中间体水分的方法。方法 采集GFC总混颗粒和TC总混颗粒的NIRS，考察不同的预处理方法、变量筛选方法及算法对模型的影响，筛选最佳建模条件，并对2种中间体建立1个水分NIRS通用定量模型。结果 对同一中间体建立定量模型时，广义路径追踪（generalized path seeker，GPS）算法均优于偏最小二乘（partial least square，PLS）算法；GPS通用模型与PLS通用模型相比，预测性能更高，验证集相对偏差（relative standard errors of prediction，RSEP）由3.17%降至3.03%，性能偏差比（ratio of performance to deviation，RPD）由4.83升至5.05，可用于水分的预测，且与独立模型的预测性能相差不大。结论 GPS算法结合NIRS技术建立的通用定量模型，可快速、准确地检测2种制剂中间体的水分。
Objective Taking Guizhi Fuling Capsules (GFC, 桂枝茯苓胶囊) and Tianshu Capsules (TC, 天舒胶囊) as research objects, a rapid method for detecting the moisture content of two preparation intermediates was established by combining near-infrared spectroscopy (NIRS) technology with machine learning algorithms. Methods The NIRS of GFC total mixed particles and TC total mixed particles were collected. The effects of different preprocessing methods, variable screening methods and algorithms on the model were investigated. The optimal modeling conditions were selected to establish a universal NIRS quantitative model for moisture content of two intermediates. Results The generalized path seeker (GPS) algorithm was superior to the partial least squares (PLS) algorithm in establishing quantitative models for the same intermediate. Compared with the PLS universal model, the GPS universal model had higher predictive performance, with the relative standard errors of prediction (RSEP) decreasing from 3.17% to 3.03%, and the ratio of performance to deviation (RPD) increasing from 4.83 to 5.05. The GPS universal model could be used to predict the moisture content of intermediates, and there was little difference in prediction accuracy between GPS and that of the independent models. Conclusion The universal quantitative model established by GPS algorithm combined with NIRS technology could quickly and accurately determine the moisture content of two preparation intermediates.