I want to be able to add a dummy label for each substructure such that if this label is chosen then I pay a lower cost. As an example, suppose we use the OCR letters, I want to be able to add a dummy label on top of the 26 letters. Note that in particular, this dummy label will never appear in the training or test data. The caveat is that if I choose to label a substructure according to this dummy label, then I pay a different price than if I had chosen a usual label. Say we take the Hamming loss L(y,y') where y' is the true label from the training data. Suppose that on the kth substructure, I choose the dummy label so y_k=dummy label, then I won't pay the usual price 1_{y_k\neq y'_k}, but instead pay 0.05* 1_{y_k\neq y'_k}. I have never used pystruct before, but it seems to me that all I have to do is simply
ChainCRF(n_states=27,class_weight=[1]*26+[0.05])
I noticed that there is a flag that catches when your data does not have the same number of classes than what you specify in n_states, but after removing this flag would the algorithm run as intended, that is will the algorithm run as if there were 27 letters instead of 26 and assign the different weight to the Hamming loss if you choose the dummy label?
Thank you very much in advance for the help!