Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public decimal score(string x, Classification c)
- {
- decimal sum = 0;
- foreach (string w in Tokenizer.tokenize(x))
- {
- if (PxiC[c].ContainsKey(w))
- {
- decimal val = PxiC[c][w] / (1 - PxiC[c][w]);
- if (val != 0 || val > 0)
- {
- sum += (decimal)Math.Log((double)val);
- }
- }
- }
- return emptyScore[Classification.Positive] + sum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement