A new algorithm could predict Islamic State attacks