Browse Source

计算器调整

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

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

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

Loading…
Cancel
Save