A mathematical introduction to data science