A machine learning approach to predicting protein-ligand binding affinity with applications to molecular docking