updating data retrieval script to train models