wolfe-pack / wolfe

Wolfe Language and Engine
https://wolfe-pack.github.io/wolfe
Apache License 2.0
135 stars 17 forks source link

Features observed after training time lead to exception when scoring factor #62

Closed rockt closed 10 years ago

rockt commented 10 years ago

In #26 we are using a train and test corpus. There are features generated on the test corpus for which the model hasn't trained any weights (since they are unobserved during training). MPGraph should ignore these features in the score function of its Factors. A quick fix might be

result = 
  if (index >= fg.weights.size) 0 
  else singleton(index) * fg.weights(index)