Skip to content

Commit

Permalink
Normalization in TrieClassify.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Apr 9, 2018
1 parent 25a168f commit f244122
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TriesWithFrequencies.m
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ Mathematica is (C) Copyright 1988-2016 Wolfram Research, Inc.
Block[{res, dval = OptionValue[TrieClassify, "Default"]},
res = TrieRetrieve[tr, record];
If[Length[res] == 0, <|dval -> 0|>,
ReverseSort[Association[Rule @@@ TrieLeafProbabilities[res]]]
res = ReverseSort[Association[Rule @@@ TrieLeafProbabilities[res]]];
res / Total[res]
]
];

Expand Down

0 comments on commit f244122

Please sign in to comment.