Esempio n. 1
0
 private double NormalizedErrorObsNormed(PatternFeature feature, double modelValue) {
   /*
    * the w here is manual weight assigned in JSON. only for special cases!! like 3-000 to get D.ASP.
    * shouldn't be confused with dynamic W calculated in spikepatternclassifier
    * Typically, w is 0 in JSON, so that this manual weight is ignored!
    */
   double w = feature.getWeight();
   if (GeneralUtils.isCloseEnough(w, 0, 0.001)) {
     w = 1;
   }
   if (feature.isRange()) {
     return w
         * StatUtil.calculateObsNormalizedError(
             feature.getValueMin(), feature.getValueMax(), modelValue);
   } else {
     return w * StatUtil.calculateObsNormalizedError(feature.getValue(), modelValue);
   }
 }