by replace "p not in range(len(X))" with " p < 0 or p >= len(X)",
avoid creating a list(in Python2) and iterating comparing.
as instance, for 420K lines input data, speed up from 59s to 20s.
Attention: it is a fix for example/crfsuites.py, which is just a utils to generate training data according to the template, not the main program.
by replace "p not in range(len(X))" with " p < 0 or p >= len(X)", avoid creating a list(in Python2) and iterating comparing. as instance, for 420K lines input data, speed up from 59s to 20s.
Attention: it is a fix for example/crfsuites.py, which is just a utils to generate training data according to the template, not the main program.