Although satellite remote sensing technology is intensively used for the monitoring of water quality, the inversion of coastal water bodies and non-optically active parameters is still a challenging issue. Few ongoing studies use remote sensing technology to analyze the driving forces of changes in water quality from multiple aspects based on inversion results. By the use of Landsat 5/8 imagery and measured in situ data of the total nitrogen (TN) and total phosphorus (TP) in the Shenzhen-Hong Kong Bay area from 1986 to 2020, this study evaluated the modeling effects of four machine learning methods named Tree Embedding (TE), Support Vector Regression (SVR), Gaussian Process Regression (GPR), and Back-propagation Neural Network (BPNN). The results show that the BPNN creates the most reliable and robust results. The values of the obtained correlation coefficients (r) are 0.83, 0.92, 0.84, and 0.90, and that of the coefficients of determination (R2) are 0.70, 0.84, 0.70, and 0.81. The calculated mean absolute errors (MAEs) are 0.41, 0.16, 0.06, and 0.02, while the root mean square errors (RMSEs) are 0.78, 0.29, 0.12, and 0.03. The concentrations of TN and TP (CTN, CTP) in the Shenzhen Bay, the Starling Inlet, and the Tolo Harbor were relatively high, fluctuated from 1986 to 2010, and decreased significantly after 2010. The CTN and CTP in the Mirs Bay kept continuously at a low level. We found that urbanization and polluted river discharges were the main drivers of spatial and inter-annual differences of CTN and CTP. Temperature, precipitation, and wind are further factors that influenced the intra-annual changes of CTN and CTP in the Shenzhen Bay, whilethe expansion of oyster rafts and mangroves had little effect. Our research confirms that machine learning algorithms are well suited for the inversion of non-optical activity parameters of coastal water bodies, and also shows the potential of remote sensing for large-scale, long-term monitoring of water quality and the subsequent comprehensive analysis of the driving forces.