Skip to content

Commit

Permalink
Merge pull request #176 from HPI-Information-Systems/fix/total-count-…
Browse files Browse the repository at this point in the history
…calculation

Fix calculation of total count
  • Loading branch information
phpfs authored May 5, 2021
2 parents 7a4e5c5 + f7698e2 commit 1cd3ad5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/pages/BinaryMetricsPage/BinaryMetricsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Store } from 'store/models';
import { MetricsTuplesCategories } from 'types/MetricsTuplesCategories';
import { TuplesLoader } from 'types/TuplesLoader';
import { intersectionDescription } from 'utils/intersectionDescription';
import { numberOfDistinctPairs } from 'utils/numberOfDistinctPairs';

const getCountsByTuplesCategory = (
store: Store,
Expand Down Expand Up @@ -118,9 +119,8 @@ const mapStateToProps = (state: Store): BinaryMetricsPageStateProps => ({
state.BinaryMetricsStore.selectedDataView
),
confusionMatrix: {
totalCount: Math.pow(
state.BenchmarkConfigurationStore.selectedDataset?.numberOfRecords ?? 0,
2
totalCount: numberOfDistinctPairs(
state.BenchmarkConfigurationStore.selectedDataset?.numberOfRecords ?? 0
),
falseNegatives: getPairCountByTuplesCategory(
state,
Expand Down
2 changes: 2 additions & 0 deletions app/src/utils/numberOfDistinctPairs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const numberOfDistinctPairs = (size: number): number =>
(size * (size - 1)) / 2;

0 comments on commit 1cd3ad5

Please sign in to comment.