Class IndexExtractor
java.lang.Object
org.tribuo.data.columnar.extractors.IndexExtractor
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,FieldExtractor<Long>
An Extractor with special casing for loading the index from a Row.
The index is written out as a Long.
This is the row wise count, i.e., the number of examples that the data source has processed, rather than anything extracted from the data.
-
Constructor Summary
ConstructorDescriptionExtracts the index writing to the default metadata field nameExample.NAME
.IndexExtractor
(String metadataName) Extracts the index, writing to the supplied metadata field name. -
Method Summary
Modifier and TypeMethodDescriptionReturns Optional which is filled if extraction succeeded.Gets the metadata key name.com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
Gets the class of the value produced by this extractor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
IndexExtractor
Extracts the index, writing to the supplied metadata field name.- Parameters:
metadataName
- The metadata field to write to.
-
IndexExtractor
public IndexExtractor()Extracts the index writing to the default metadata field nameExample.NAME
.
-
-
Method Details
-
getMetadataName
Description copied from interface:FieldExtractor
Gets the metadata key name. This is the key into which this value will be written in anExample
if it is given toRowProcessor
.- Specified by:
getMetadataName
in interfaceFieldExtractor<Long>
- Returns:
- The metadata key name.
-
getValueType
Description copied from interface:FieldExtractor
Gets the class of the value produced by this extractor.- Specified by:
getValueType
in interfaceFieldExtractor<Long>
- Returns:
- The class of the value.
-
extract
Description copied from interface:FieldExtractor
Returns Optional which is filled if extraction succeeded.- Specified by:
extract
in interfaceFieldExtractor<Long>
- Parameters:
row
- The raw row from which to extract a value- Returns:
- A value.
-
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>
-