Using Machine Learning to Get the Most Out of Electric Vehicle Batteries