|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.Operator
com.rapidminer.operator.AbstractExampleSetProcessing
com.rapidminer.operator.preprocessing.AbstractDataProcessing
com.rapidminer.operator.preprocessing.filter.NumericToNominal
com.rapidminer.operator.preprocessing.filter.NumericToFormattedNominal
public class NumericToFormattedNominal
This operator tries to parse numerical values and formats them in the specified number format. It also supports different kinds of numbers, including integers (123), fixed-point numbers (123.4), scientific notation (1.23E4), percentages (12%), and currency amounts ($123). The format type parameter specifies the basic format, in all cases but for "pattern" the specified locale will be used. In case of pattern the locale is ignored and the specified pattern is used instead.
Please note that this operator only works on numerical attributes and the result will be in any case a nominal attribute no matter if the resulting format would again be a parsable number.
In case of the pattern format type, a pattern parameter is used to define the
format. If two different formats for positive and negative numbers should be used, those
formats can be defined by a separating ';'. The pattern must have the following
structure:
pattern := subpattern{;subpattern}
subpattern := {prefix}integer{.fraction}{suffix}
prefix := any character combination including white space
suffix := any character combination including white space
integer := '#'* '0'* '0'
fraction := '0'* '#'*
The following placeholders can be used within the pattern parameter:
0 a digit
# a digit, zero shows as absent
. placeholder for decimal separator
, placeholder for grouping separator.
E separates mantissa and exponent for exponential formats.
- default negative prefix.
% multiply by 100 and show as percentage
X any other characters can be used in the prefix or suffix
' used to quote special characters in a prefix or suffix.
| Field Summary | |
|---|---|
static java.lang.String[] |
availableLocaleNames
|
static java.util.List<java.util.Locale> |
availableLocales
|
static int |
defaultLocale
|
static int |
FORMAT_TYPE_CURRENCY
|
static int |
FORMAT_TYPE_INTEGER
|
static int |
FORMAT_TYPE_NUMBER
|
static int |
FORMAT_TYPE_PATTERN
|
static int |
FORMAT_TYPE_PERCENT
|
static java.lang.String[] |
FORMAT_TYPES
|
static java.lang.String |
PARAMETER_FORMAT_TYPE
|
static java.lang.String |
PARAMETER_LOCALE
|
static java.lang.String |
PARAMETER_PATTERN
|
static java.lang.String |
PARAMETER_USE_GROUPING
|
| Constructor Summary | |
|---|---|
NumericToFormattedNominal(OperatorDescription description)
|
|
| Method Summary | |
|---|---|
void |
cleanUp()
Will be invoked after the setValue method was invoked for each example. |
protected int |
getGeneratedAttributevalueType()
Returns Ontology.NOMINAL or one of its subtypes. |
java.util.List<ParameterType> |
getParameterTypes()
Returns a list of ParameterTypes describing the parameters of this operator. |
void |
init()
Will be invoked before the setValue method is invoked for each example. |
protected void |
setValue(Example example,
Attribute newAttribute,
double value)
|
| Methods inherited from class com.rapidminer.operator.preprocessing.filter.NumericToNominal |
|---|
apply, makeAttribute |
| Methods inherited from class com.rapidminer.operator.AbstractExampleSetProcessing |
|---|
apply, getInputClasses, getOutputClasses |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PARAMETER_FORMAT_TYPE
public static final java.lang.String PARAMETER_PATTERN
public static final java.lang.String PARAMETER_LOCALE
public static final java.lang.String PARAMETER_USE_GROUPING
public static final java.lang.String[] FORMAT_TYPES
public static final int FORMAT_TYPE_NUMBER
public static final int FORMAT_TYPE_INTEGER
public static final int FORMAT_TYPE_CURRENCY
public static final int FORMAT_TYPE_PERCENT
public static final int FORMAT_TYPE_PATTERN
public static java.util.List<java.util.Locale> availableLocales
public static java.lang.String[] availableLocaleNames
public static int defaultLocale
| Constructor Detail |
|---|
public NumericToFormattedNominal(OperatorDescription description)
| Method Detail |
|---|
public void init()
throws OperatorException
NumericToNominal
init in class NumericToNominalOperatorException
public void cleanUp()
throws OperatorException
NumericToNominal
cleanUp in class NumericToNominalOperatorException
protected void setValue(Example example,
Attribute newAttribute,
double value)
setValue in class NumericToNominalpublic java.util.List<ParameterType> getParameterTypes()
Operator
getParameterTypes in interface ParameterHandlergetParameterTypes in class Operatorprotected int getGeneratedAttributevalueType()
NumericToNominalOntology.NOMINAL or one of its subtypes.
getGeneratedAttributevalueType in class NumericToNominal
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||