How machine learning is used to defend networks and catch hackers