Machine Learning Methods for Network Intrusion Detection and Intrusion Prevention Systems