org.encog.ml.data.versatile.normalizers

## Class RangeOrdinal

- java.lang.Object
- - org.encog.ml.data.versatile.normalizers.RangeOrdinal

- All Implemented Interfaces:
    Normalizer

      public class RangeOrdinal
      extends Object
      implements Normalizer

  Normalize an ordinal into a specific range. An ordinal is a string value that has order. For example "first grade", "second grade", ... "freshman", ..., "senior". These values are mapped to an increasing index.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RangeOrdinal(double theNormalizedLow, double theNormalizedHigh)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `denormalizeColumn(ColumnDefinition colDef, MLData data, int dataColumn)` Denormalize a value.
    `int` | `normalizeColumn(ColumnDefinition colDef, double value, double[] outputData, int outputColumn)` Normalize a column from a double.
    `int` | `normalizeColumn(ColumnDefinition colDef, String theValue, double[] outputData, int outputColumn)` Normalize a column from a string.
    `int` | `outputSize(ColumnDefinition colDef)` Determine the normalized size of the specified column.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RangeOrdinal

          public RangeOrdinal(double theNormalizedLow,
                      double theNormalizedHigh)

  - ### Method Detail

    - #### outputSize

          public int outputSize(ColumnDefinition colDef)

      Determine the normalized size of the specified column.
      Specified by:
        `outputSize` in interface `Normalizer`
      Parameters:
        `colDef` - The column to check.
      Returns:
        The size of the column normalized.

    - #### normalizeColumn

          public int normalizeColumn(ColumnDefinition colDef,
                            String theValue,
                            double[] outputData,
                            int outputColumn)

      Normalize a column from a string. The output will go to an array, starting at outputColumn.
      Specified by:
        `normalizeColumn` in interface `Normalizer`
      Parameters:
        `colDef` - The column that is being normalized.
        `theValue` - The value to normalize.
        `outputData` - The array to output to.
        `outputColumn` - The index to start at in outputData.
      Returns:
        The new index (in outputData) that we've moved to.

    - #### normalizeColumn

          public int normalizeColumn(ColumnDefinition colDef,
                            double value,
                            double[] outputData,
                            int outputColumn)

      Normalize a column from a double. The output will go to an array, starting at outputColumn.
      Specified by:
        `normalizeColumn` in interface `Normalizer`
      Parameters:
        `colDef` - The column that is being normalized.
        `value` - The value to normalize.
        `outputData` - The array to output to.
        `outputColumn` - The index to start at in outputData.
      Returns:
        The new index (in outputData) that we've moved to.

    - #### denormalizeColumn

          public String denormalizeColumn(ColumnDefinition colDef,
                                 MLData data,
                                 int dataColumn)

      Denormalize a value.
      Specified by:
        `denormalizeColumn` in interface `Normalizer`
      Parameters:
        `colDef` - The column to denormalize.
        `data` - The data to denormalize.
        `dataColumn` - The starting location inside data.
      Returns:
        The denormalized value.

Copyright © 2014. All Rights Reserved.