org.encog.util.normalize.output.mapped
Class OutputFieldEncode
- java.lang.Object
-
- org.encog.util.normalize.output.BasicOutputField
-
- org.encog.util.normalize.output.mapped.OutputFieldEncode
-
- All Implemented Interfaces:
- java.io.Serializable, OutputField
public class OutputFieldEncode extends BasicOutputField
An encoded output field. This allows ranges of output values to be mapped to specific values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description OutputFieldEncode(InputField sourceField)Construct an encoded field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddRange(double low, double high, double value)Add a ranged mapped to a value.doublecalculate(int subfield)Calculate the value for this field.doublegetCatchAll()InputFieldgetSourceField()intgetSubfieldCount()voidrowInit()Not needed for this sort of output field.voidsetCatchAll(double catchAll)Set the catch all value.-
Methods inherited from class org.encog.util.normalize.output.BasicOutputField
isIdeal, setIdeal
-
-
-
-
Constructor Detail
-
OutputFieldEncode
public OutputFieldEncode(InputField sourceField)
Construct an encoded field.- Parameters:
sourceField- The field that this is based on.
-
-
Method Detail
-
addRange
public void addRange(double low, double high, double value)Add a ranged mapped to a value.- Parameters:
low- The low value for the range.high- The high value for the range.value- The value that the field should produce for this range.
-
calculate
public double calculate(int subfield)
Calculate the value for this field.- Parameters:
subfield- Not used.- Returns:
- Return the value for the range the input falls within, or return the catchall if nothing matches.
-
getCatchAll
public double getCatchAll()
- Returns:
- The catch all value that will be returned if nothing matches.
-
getSourceField
public InputField getSourceField()
- Returns:
- The source field.
-
getSubfieldCount
public int getSubfieldCount()
- Returns:
- Return 1, no subfield supported.
-
rowInit
public void rowInit()
Not needed for this sort of output field.
-
setCatchAll
public void setCatchAll(double catchAll)
Set the catch all value.- Parameters:
catchAll- The catch all value that is to be returned if none of the ranges match.
-
-
DMelt 3.0 © DataMelt by jWork.ORG