A consensus-based global optimization method for high dimensional machine learning problems