public class MetadataUtils
extends Object
Constructor and Description |
---|
MetadataUtils() |
Modifier and Type | Method and Description |
---|---|
static scala.collection.immutable.Map<Object,Object> |
getCategoricalFeatures(StructField featuresSchema)
Examine a schema to identify categorical (Binary and Nominal) features.
|
static int[] |
getFeatureIndicesFromNames(StructField col,
String[] names)
Takes a Vector column and a list of feature names, and returns the corresponding list of
feature indices in the column, in order.
|
static scala.Option<Object> |
getNumClasses(StructField labelSchema)
Examine a schema to identify the number of classes in a label column.
|
static scala.Option<Object> |
getNumFeatures(StructField vectorSchema)
Examine a schema to identify the number of features in a vector column.
|
public static scala.Option<Object> getNumClasses(StructField labelSchema)
labelSchema
- (undocumented)public static scala.Option<Object> getNumFeatures(StructField vectorSchema)
vectorSchema
- (undocumented)public static scala.collection.immutable.Map<Object,Object> getCategoricalFeatures(StructField featuresSchema)
featuresSchema
- Schema of the features column.
If a feature does not have metadata, it is assumed to be continuous.
If a feature is Nominal, then it must have the number of values
specified.public static int[] getFeatureIndicesFromNames(StructField col, String[] names)
col
- Vector column which must have feature names specified via attributesnames
- List of feature names