| Package | Description |
|---|---|
| org.datavec.api.transform | |
| org.datavec.api.transform.transform.categorical |
| Modifier and Type | Method and Description |
|---|---|
TransformProcess.Builder |
TransformProcess.Builder.firstDigitTransform(String inputColumn,
String outputColumn,
FirstDigitTransform.Mode mode)
FirstDigitTransform converts a column to a categorical column, with values being the first digit of the number.
For example, "3.1415" becomes "3" and "2.0" becomes "2". Negative numbers ignore the sign: "-7.123" becomes "7". Note that two FirstDigitTransform.Modes are supported, which determines how non-numerical entries should be handled:EXCEPTION_ON_INVALID: output has 10 category values ("0", ..., "9"), and any non-numerical values result in an exception INCLUDE_OTHER_CATEGORY: output has 11 category values ("0", ..., "9", "Other"), all non-numerical values are mapped to "Other" FirstDigitTransform is useful (combined with CategoricalToOneHotTransform and Reductions) to implement
Benford's law. |
| Modifier and Type | Field and Description |
|---|---|
protected FirstDigitTransform.Mode |
FirstDigitTransform.mode |
| Modifier and Type | Method and Description |
|---|---|
static FirstDigitTransform.Mode |
FirstDigitTransform.Mode.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FirstDigitTransform.Mode[] |
FirstDigitTransform.Mode.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Constructor and Description |
|---|
FirstDigitTransform(String inputColumn,
String outputColumn,
FirstDigitTransform.Mode mode) |
Copyright © 2020. All rights reserved.