Browse Source

批量归一算法 返回原始值

master
jianjun 5 years ago
parent
commit
d5b1c5a225
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -37,7 +37,7 @@ public class BatchScoreCalculator {
} }
/** /**
* 执行计算以样本的所有指标总得分及明细分数值 * 执行计算以样本的所有指标总得分原始值及明细分数归一后的值 不乘以权重
* *
* @param indexInputVOS * @param indexInputVOS
* @return * @return
@ -56,7 +56,9 @@ public class BatchScoreCalculator {
//遍历该指标下的每个数据 //遍历该指标下的每个数据
for (SampleValue vo : indexValueVOs) { for (SampleValue vo : indexValueVOs) {
String sampleId = vo.getSampleId(); String sampleId = vo.getSampleId();
BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); //归一后的值
BigDecimal normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
BigDecimal score = scoreCalculator.normalize(normalizeValue, weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId); CalculateResult result = scoreCountOfSamples.get(sampleId);
if (result == null) { if (result == null) {
@ -67,7 +69,7 @@ public class BatchScoreCalculator {
result.setDetails(new ArrayList<>()); result.setDetails(new ArrayList<>());
scoreCountOfSamples.put(sampleId, result); scoreCountOfSamples.put(sampleId, result);
} }
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score, idx.getWeight()); IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight());
result.getDetails().add(sampleScore); result.getDetails().add(sampleScore);
result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP));
} }

Loading…
Cancel
Save