Documentation of 'org.encog.ml.data.versatile.NormalizationHelper' Java class
NormalizationHelper
org.encog.ml.data.versatile

Class NormalizationHelper

  • All Implemented Interfaces:
    java.io.Serializable


    public class NormalizationHelper
    extends java.lang.Object
    implements java.io.Serializable
    This class is used to perform normalizations for methods trained with the versatile dataset.
    See Also:
    Serialized Form
    • Constructor Detail

      • NormalizationHelper

        public NormalizationHelper()
    • Method Detail

      • getSourceColumns

        public java.util.List<ColumnDefinition> getSourceColumns()
        Returns:
        the sourceColumns
      • setSourceColumns

        public void setSourceColumns(java.util.List<ColumnDefinition> sourceColumns)
        Parameters:
        sourceColumns - the sourceColumns to set
      • getInputColumns

        public java.util.List<ColumnDefinition> getInputColumns()
        Returns:
        the inputColumns
      • setInputColumns

        public void setInputColumns(java.util.List<ColumnDefinition> inputColumns)
        Parameters:
        inputColumns - the inputColumns to set
      • getOutputColumns

        public java.util.List<ColumnDefinition> getOutputColumns()
        Returns:
        the outputColumns
      • setOutputColumns

        public void setOutputColumns(java.util.List<ColumnDefinition> outputColumns)
        Parameters:
        outputColumns - the outputColumns to set
      • setNormStrategy

        public void setNormStrategy(NormalizationStrategy normStrategy)
        Parameters:
        normStrategy - the normStrategy to set
      • addSourceColumn

        public void addSourceColumn(ColumnDefinition def)
        Add a source column. These define the raw input.
        Parameters:
        def - The column definition.
      • defineSourceColumn

        public ColumnDefinition defineSourceColumn(java.lang.String name,
                                                   int index,
                                                   ColumnType colType)
        Define a source column. These define the raw input. Use this function if you know the index of the column in a non-header file.
        Parameters:
        name - The name of the column.
        index - The index of the column, needed for non-headered files.
        colType - The column type.
        Returns:
        The column definition
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clearInputOutput

        public void clearInputOutput()
        Clear the input/output columns, but not the source columns.
      • normalizeInputColumn

        public double[] normalizeInputColumn(int i,
                                             java.lang.String value)
        Normalize a single input column.
        Parameters:
        i - The column definition index (from the input columns).
        value - The value to normalize.
        Returns:
        The normalized result.
      • normalizeOutputColumn

        public double[] normalizeOutputColumn(int i,
                                              java.lang.String value)
        Normalize a single output column.
        Parameters:
        i - The column definition index (from the output columns).
        value - The value to normalize.
        Returns:
        The normalized result.
      • calculateNormalizedInputCount

        public int calculateNormalizedInputCount()
        Returns:
        The number of elements the input will normalize to.
      • calculateNormalizedOutputCount

        public int calculateNormalizedOutputCount()
        Returns:
        The number of elements the output will normalize to.
      • allocateInputVector

        public MLData allocateInputVector()
        Allocate a data item large enough to hold a single input vector.
        Returns:
        The data element.
      • allocateInputVector

        public MLData allocateInputVector(int multiplier)
        Allocate a data item large enough to hold several input vectors. This is normally used for timeslices.
        Parameters:
        multiplier - How many input vectors.
        Returns:
        The data element.
      • denormalizeOutputVectorToString

        public java.lang.String[] denormalizeOutputVectorToString(MLData output)
        Denormalize a complete output vector to an array of strings.
        Parameters:
        output - The data vector to denorm, the source.
        Returns:
        The denormalized vector.
      • setStrategy

        public void setStrategy(NormalizationStrategy strat)
        Set the normalization strategy.
        Parameters:
        strat - The strategy.
      • getFormat

        public CSVFormat getFormat()
        Returns:
        the format
      • setFormat

        public void setFormat(CSVFormat format)
        Parameters:
        format - the format to set
      • getUnknownValues

        public java.util.List<java.lang.String> getUnknownValues()
        Returns:
        the unknownValues
      • defineUnknownValue

        public void defineUnknownValue(java.lang.String str)
        Define the string that signifies an unknown value (eg "?")
        Parameters:
        str - The string for unknowns.
      • normalizeToVector

        public int normalizeToVector(ColumnDefinition colDef,
                                     int outputColumn,
                                     double[] output,
                                     boolean isInput,
                                     java.lang.String value)
        Normalize a single column to the input vector.
        Parameters:
        colDef - The column to normalize.
        outputColumn - The current position in the vector.
        output - The vector to output to.
        isInput - Is this an input column.
        value - The value to normalize.
        Returns:
        The new current position in the vector.
      • parseDouble

        public double parseDouble(java.lang.String str)
        Parse a double, using the correct formatter.
        Parameters:
        str - The string.
        Returns:
        The double.
      • defineMissingHandler

        public void defineMissingHandler(ColumnDefinition colDef,
                                         MissingHandler handler)
        Define a missing value handler.
        Parameters:
        colDef - The column this handler applies to.
        handler - The handler.
      • normalizeInputVector

        public void normalizeInputVector(java.lang.String[] line,
                                         double[] data,
                                         boolean originalOrder)
        Normalize a string array to an input vector.
        Parameters:
        line - The unnormalized string array.
        data - The output data.
        originalOrder - Should the output be forced into the original column order?

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.