Learning State Machines faster using Locality-Sensitive Hashing and an application in network-based threat detection