Fitbit for cows and the dark magic of machine learning