What is the number of features in CRFsuite / python-crfsuite? I wonder what the number of features is in python-crfsuite
.
I thought that the number of features was the number of attributes multiplied by the number of labels, e.g.:
Number of active features: 2 (15)
Number of active attributes: 1 (5)
Number of active labels: 3 (3)

But I see it is not the case in some of my data sets, e.g.:
Number of active features: 24 (30)
Number of active attributes: 4 (4)
Number of active labels: 4 (4)

(the number of features is the number in parentheses, viz. 15 in the first example and 30 in the second example)
Since python-crfsuite is just a (great) Python wrapper around the C++ library CRFsuite, the same question applies to CRFsuite.
 A: The number of features (in parentheses)  will depend on whether you have True/False set for the feature.possible_states and feature.possible_transitions parameters.
The maximum number of possible features can only be achieved when both of these parameters are set to True. In this case the number of features will be:
(number of attributes * number of labels) + (number of labels * number of labels)
Where the first term is the maximum number of state features, and the second term is the maximum number of transition features. 
However, this will also include features which are not observed in the training data, for example a feature which represents the transition between two labels which never occurs in the training data is still assigned a weight. 
By default these parameters are set to False (to reduce training time) so only features observed in the training data are included, and this explains the results you are seeing. 
In the first example your maximum number of features is (3 * 5) + (3 * 3) = 24, and in the second example it is (4 * 4) + (4 * 4) = 32, these are the values you would see if you set both parameters to True. 
