Consensus-based Optimization on the Sphere II: Convergence to Global Minimizers and Machine Learning