Package org.apache.spark.ml.attribute
Class Attribute
Object
org.apache.spark.ml.attribute.Attribute
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BinaryAttribute,NominalAttribute,NumericAttribute
Abstract class for ML attributes.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AttributeTypeattrType()Attribute type.static AttributefromStructField(StructField field) abstract scala.Option<Object>index()Index of the attribute.abstract booleanTests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute.abstract booleanTests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute.abstract scala.Option<String>name()Name of the attribute.Converts to ML metadatatoMetadata(Metadata existingMetadata) Converts to ML metadata with some existing metadata.toString()Converts to aStructField.toStructField(Metadata existingMetadata) Converts to aStructFieldwith some existing metadata.abstract AttributewithIndex(int index) Copy with a new index.abstract AttributeCopy with a new name.abstract AttributeCopy without the index.abstract AttributeCopy without the name.
-
Constructor Details
-
Attribute
public Attribute()
-
-
Method Details
-
fromStructField
-
attrType
Attribute type. -
name
Name of the attribute. None if it is not set. -
withName
Copy with a new name. -
withoutName
Copy without the name. -
index
Index of the attribute. None if it is not set. -
withIndex
Copy with a new index. -
withoutIndex
Copy without the index. -
isNumeric
public abstract boolean isNumeric()Tests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute.- Returns:
- (undocumented)
-
isNominal
public abstract boolean isNominal()Tests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute.- Returns:
- (undocumented)
-
toMetadata
Converts to ML metadata with some existing metadata. -
toMetadata
Converts to ML metadata -
toStructField
Converts to aStructFieldwith some existing metadata.- Parameters:
existingMetadata- existing metadata to carry over- Returns:
- (undocumented)
-
toStructField
Converts to aStructField.- Returns:
- (undocumented)
-
toString
-