adding prediction function to datasets