A Survey on Machine Learning Techniques for Detecting, Mitigating, and Preventing Intrusions