Interface FeatureBuilder
-
- All Known Implementing Classes:
ArrayFeatureBuilder
,BaseFeatureBuilder
,FloatFeatureBuilder
,IntFeatureBuilder
,StringFeatureBuilder
,UnknownFeatureBuilder
public interface FeatureBuilder
Interface for building a CortexFeature
corresponding to a SparkDataType
and CortexFeatureType
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description com.c12e.cortex.phoenix.Feature
build()
Build and creates an instantiatedFeature
instance.java.lang.String
getDataType()
String representation of the SparkDataType
for the feature.java.lang.String
getFeatureType()
String representation of the feature type in Cortex (e.g.default void
inferFromSample(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> sampleDf, java.lang.String fieldName)
Infers feature properties based on the Dataset sample.
-
-
-
Method Detail
-
getDataType
java.lang.String getDataType()
String representation of the SparkDataType
for the feature.- Returns:
- String data type
-
getFeatureType
java.lang.String getFeatureType()
String representation of the feature type in Cortex (e.g. "numeric", "categorical").- Returns:
- String feature type
-
build
com.c12e.cortex.phoenix.Feature build()
Build and creates an instantiatedFeature
instance.- Returns:
- instantiated feature
-
inferFromSample
default void inferFromSample(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> sampleDf, java.lang.String fieldName)
Infers feature properties based on the Dataset sample. Defaulted to a no-op.- Parameters:
sampleDf
- sample data to infer the Feature properties fromfieldName
- name of the field in the Dataset
-
-