Skip to content

Commit

Permalink
Fix a bug in parse response to get expected value (#306)
Browse files Browse the repository at this point in the history
* fix failed unit tests

Signed-off-by: Jackie Han <[email protected]>

* Fix parse result bug for feature attribution

Signed-off-by: Jackie Han <[email protected]>

Signed-off-by: Jackie Han <[email protected]>
(cherry picked from commit 7ace8b4)
  • Loading branch information
jackiehanyang authored and ohltyler committed Aug 10, 2022
1 parent a3e96d4 commit b8799f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/routes/ad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ export default class AdService {
? toFixedNumberForAnomaly(Number.parseFloat(featureData.data))
: 0,
name: featureData.feature_name,
expectedValue: result.anomaly_grade > 0
expectedValue: result._source.anomaly_grade > 0
? this.getExpectedValue(result, featureData.feature_id) : featureData.data
});
});
Expand Down Expand Up @@ -1135,7 +1135,7 @@ export default class AdService {
? toFixedNumberForAnomaly(Number.parseFloat(featureData.data))
: 0,
name: featureData.feature_name,
expectedValue: rawResult.anomaly_grade > 0
expectedValue: rawResult._source.anomaly_grade > 0
? this.getExpectedValue(rawResult, featureData.feature_id)
: featureData.data
};
Expand Down

0 comments on commit b8799f4

Please sign in to comment.