General function for machine learning, data manipulation, stats and information theory related measures.