public class MinMaxNormalizer extends BaseDoubleTransform
Mathematically: (newMax-newMin)/(max-min) * (x-min) + newMin
Modifier and Type | Field and Description |
---|---|
protected double |
max |
protected double |
min |
protected double |
newMax |
protected double |
newMin |
protected double |
ratio |
columnName, columnNumber
inputSchema
Constructor and Description |
---|
MinMaxNormalizer(java.lang.String columnName,
double min,
double max) |
MinMaxNormalizer(java.lang.String columnName,
double min,
double max,
double newMin,
double newMax) |
Modifier and Type | Method and Description |
---|---|
ColumnMetaData |
getNewColumnMetaData(java.lang.String newColumnName,
ColumnMetaData oldColumnMeta) |
java.lang.Object |
map(java.lang.Object input)
Transform an object
in to another object
|
Writable |
map(Writable writable) |
java.lang.String |
toString() |
columnName, columnNames, equals, hashCode, map, mapSequence, outputColumnName, outputColumnNames, setInputSchema, transform
getInputSchema, mapSequence
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getInputSchema
protected final double min
protected final double max
protected final double newMin
protected final double newMax
protected final double ratio
public MinMaxNormalizer(java.lang.String columnName, double min, double max)
public MinMaxNormalizer(java.lang.String columnName, double min, double max, double newMin, double newMax)
public Writable map(Writable writable)
map
in class BaseDoubleTransform
public ColumnMetaData getNewColumnMetaData(java.lang.String newColumnName, ColumnMetaData oldColumnMeta)
getNewColumnMetaData
in class BaseDoubleTransform
public java.lang.String toString()
toString
in class BaseColumnTransform
public java.lang.Object map(java.lang.Object input)
input
- the record to transform