Class DoubleFieldProcessor
java.lang.Object
org.tribuo.data.columnar.processors.field.DoubleFieldProcessor
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,FieldProcessor
Processes a column that contains a real value. The name of the feature
will be the name given for the column and the value will be the value in the
column. This processor returns all doubles that can be parsed by
Double.parseDouble(String)
including zeros, and so will emit zero valued features.
Returns an empty list if the value failed to parse or was empty.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.tribuo.data.columnar.FieldProcessor
FieldProcessor.GeneratedFeatureType
-
Field Summary
Fields inherited from interface org.tribuo.data.columnar.FieldProcessor
NAMESPACE
-
Constructor Summary
ConstructorDescriptionDoubleFieldProcessor
(String fieldName) Constructs a field processor which extracts a single double valued feature from the specified field name.DoubleFieldProcessor
(String fieldName, boolean onlyFieldName) Constructs a field processor which extracts a single double valued feature from the specified field name.DoubleFieldProcessor
(String fieldName, boolean onlyFieldName, boolean throwOnInvalid) Constructs a field processor which extracts a single double valued feature from the specified field name. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this FieldProcessor bound to the supplied newFieldName.Returns the feature type this FieldProcessor generates.Gets the field name this FieldProcessor uses.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
Processes the field value and generates a (possibly empty) list ofColumnarFeature
s.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.data.columnar.FieldProcessor
getNumNamespaces
-
Constructor Details
-
DoubleFieldProcessor
Constructs a field processor which extracts a single double valued feature from the specified field name.Generates features named "<fieldName>@value" where <fieldName> is the argument to this constructor, and does not throw an exception if the value failed to parse.
- Parameters:
fieldName
- The field name to read.
-
DoubleFieldProcessor
Constructs a field processor which extracts a single double valued feature from the specified field name.Generates features named "<fieldName>@value" where <fieldName> is the argument to this constructor if
onlyFieldName
is false, otherwise generates features named "<fieldName>". Does not throw an exception if the value failed to parse.- Parameters:
fieldName
- The field name to read.onlyFieldName
- Only use the field name as the feature name.
-
DoubleFieldProcessor
Constructs a field processor which extracts a single double valued feature from the specified field name.Generates features named "<fieldName>@value" where <fieldName> is the argument to this constructor if
onlyFieldName
is false, otherwise generates features named "<fieldName>".- Parameters:
fieldName
- The field name to read.onlyFieldName
- Only use the field name as the feature name.throwOnInvalid
- Throw NumberFormatException if the value failed to parse.
-
-
Method Details
-
getFieldName
Description copied from interface:FieldProcessor
Gets the field name this FieldProcessor uses.- Specified by:
getFieldName
in interfaceFieldProcessor
- Returns:
- The field name.
-
process
Description copied from interface:FieldProcessor
Processes the field value and generates a (possibly empty) list ofColumnarFeature
s.- Specified by:
process
in interfaceFieldProcessor
- Parameters:
value
- The field value to process.- Returns:
- A list of
ColumnarFeature
s.
-
getFeatureType
Description copied from interface:FieldProcessor
Returns the feature type this FieldProcessor generates.- Specified by:
getFeatureType
in interfaceFieldProcessor
- Returns:
- The feature type.
-
copy
Description copied from interface:FieldProcessor
Returns a copy of this FieldProcessor bound to the supplied newFieldName.- Specified by:
copy
in interfaceFieldProcessor
- Parameters:
newFieldName
- The new field name for the copy.- Returns:
- A copy of this FieldProcessor.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-