/** * Compute the inverse of the normalization (i.e. map back to a unormalized value). * * @param incoming the incoming parameter values * @return the unormalized value */ public double getResultInverse(double[] incoming) { double[] a = m_linearNormNorm; double[] b = m_linearNormOrig; return computeNorm(a, b, incoming); }
/** * Set the field definitions for this Expression to use * * @param fieldDefs the field definitions to use * @throws Exception if there is a problem setting the field definitions */ public void setFieldDefs(ArrayList<Attribute> fieldDefs) throws Exception { super.setFieldDefs(fieldDefs); setUpField(); }
result = new NormDiscrete((Element)expression, opType, fieldDefs); } else if (name.equals("NormContinuous")) { result = new NormContinuous((Element)expression, opType, fieldDefs); } else if (name.equals("Discretize")) { result = new Discretize((Element)expression, opType, fieldDefs);
private void setUpField() throws Exception { m_fieldIndex = -1; if (m_fieldDefs != null) { m_fieldIndex = getFieldDefIndex(m_fieldName); // System.err.println("NormCont... index of " + m_fieldName + " " + m_fieldIndex); if (m_fieldIndex < 0) { throw new Exception("[NormContinuous] Can't find field " + m_fieldName + " in the supplied field definitions."); } Attribute field = m_fieldDefs.get(m_fieldIndex); if (!field.isNumeric()) { throw new Exception("[NormContinuous] reference field " + m_fieldName +" must be continuous."); } } }
preds[0] = m_regressionMapping.getResultInverse(preds); } else {
result = new NormDiscrete((Element)expression, opType, fieldDefs); } else if (name.equals("NormContinuous")) { result = new NormContinuous((Element)expression, opType, fieldDefs); } else if (name.equals("Discretize")) { result = new Discretize((Element)expression, opType, fieldDefs);
private void setUpField() throws Exception { m_fieldIndex = -1; if (m_fieldDefs != null) { m_fieldIndex = getFieldDefIndex(m_fieldName); // System.err.println("NormCont... index of " + m_fieldName + " " + m_fieldIndex); if (m_fieldIndex < 0) { throw new Exception("[NormContinuous] Can't find field " + m_fieldName + " in the supplied field definitions."); } Attribute field = m_fieldDefs.get(m_fieldIndex); if (!field.isNumeric()) { throw new Exception("[NormContinuous] reference field " + m_fieldName +" must be continuous."); } } }
preds[0] = m_regressionMapping.getResultInverse(preds); } else {
/** * Compute the inverse of the normalization (i.e. map back to a unormalized value). * * @param incoming the incoming parameter values * @return the unormalized value */ public double getResultInverse(double[] incoming) { double[] a = m_linearNormNorm; double[] b = m_linearNormOrig; return computeNorm(a, b, incoming); }
/** * Set the field definitions for this Expression to use * * @param fieldDefs the field definitions to use * @throws Exception if there is a problem setting the field definitions */ public void setFieldDefs(ArrayList<Attribute> fieldDefs) throws Exception { super.setFieldDefs(fieldDefs); setUpField(); }
dummyFieldDefs.add(dummyTargetDef); m_regressionMapping = new NormContinuous((Element)normContNode, FieldMetaInfo.Optype.CONTINUOUS, dummyFieldDefs); break;
/** * Get the result of evaluating the expression. In the case * of a continuous optype, a real number is returned; in * the case of a categorical/ordinal optype, the index of the nominal * value is returned as a double. * * @param incoming the incoming parameter values * @return the result of normalizing the input field * @throws Exception if there is a problem computing the result */ public double getResult(double[] incoming) throws Exception { double[] a = m_linearNormOrig; double[] b = m_linearNormNorm; return computeNorm(a, b, incoming); }
dummyFieldDefs.add(dummyTargetDef); m_regressionMapping = new NormContinuous((Element)normContNode, FieldMetaInfo.Optype.CONTINUOUS, dummyFieldDefs); break;
/** * Get the result of evaluating the expression. In the case * of a continuous optype, a real number is returned; in * the case of a categorical/ordinal optype, the index of the nominal * value is returned as a double. * * @param incoming the incoming parameter values * @return the result of normalizing the input field * @throws Exception if there is a problem computing the result */ public double getResult(double[] incoming) throws Exception { double[] a = m_linearNormOrig; double[] b = m_linearNormNorm; return computeNorm(a, b, incoming); }