Exemple #1
0
        public void CalculateValue(DataInstance dataInstance)
        {
            // no recalculation for the x0 node
            if (IsThresholdUnit)
            {
                LogHelper.WriteDebug("Skipping Calculate() for threshold input: {0} [value:{1}]", _label, _value);
                return;
            }

            // value of an input node is simply the attribute value from the data instance
            _value = dataInstance.Attributes[Index - 1];
            LogHelper.WriteDebug("Calculate() for input: {0}; value: {1}", _label, _value);
        }
Exemple #2
0
 public void CalculateError(DataInstance dataInstance)
 {
     _error = _value * (1.0 - _value) * (dataInstance.Class - _value);
     LogHelper.WriteDebug("CalculateError() for output: {0}; value: {1}", _label, _error);
 }