Browse Source

计算器

dev_shibei_match
jianjun 5 years ago
parent
commit
1e4cc7102e
  1. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

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

@ -66,6 +66,14 @@ public class BatchScoreCalculator {
BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore();
BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore();
//1.如果是分数值(平均值)不需要归一 则 直接value*权重
//2.否则 先判断 样本值是否相等 是:反正切函数 否:归一算法
if (idx.isScore()) {
vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString()));
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
//*((max-min)/ (Math.PI/2))+min
//Math.atan(new Double(vo.getSampleValue().toString()))*
@ -77,15 +85,11 @@ public class BatchScoreCalculator {
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}else {
//如果不需要归一 则 直接value*权重
if (idx.isScore()) {
vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString()));
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
}
BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId);

Loading…
Cancel
Save