Skip to content

Commit

Permalink
[ML] Sort by normalized
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Aug 19, 2021
1 parent be26575 commit 84a0514
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,13 @@ export function FailedTransactionsCorrelations({
if (!Array.isArray(result.values)) {
return { correlationTerms: [], sorting: undefined };
}
const sortedTerms = sortBy(result.values, sortField);
const sortedTerms = sortBy(
result.values,
// The smaller the p value the higher the impact
// So we want to sort by the normalized score here
// which goes from 0 -> 1
sortField === 'pValue' ? 'normalizedScore' : sortField
);
return {
correlationTerms:
sortDirection === 'asc' ? sortedTerms : sortedTerms.reverse(),
Expand Down

0 comments on commit 84a0514

Please sign in to comment.