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 SummaryConstructors
- 
Method SummaryModifier 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- 
Attributepublic Attribute()
 
- 
- 
Method Details- 
fromStructField
- 
attrTypeAttribute type.
- 
nameName of the attribute. None if it is not set.
- 
withNameCopy with a new name.
- 
withoutNameCopy without the name.
- 
indexIndex of the attribute. None if it is not set.
- 
withIndexCopy with a new index.
- 
withoutIndexCopy without the index.
- 
isNumericpublic abstract boolean isNumeric()Tests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute.- Returns:
- (undocumented)
 
- 
isNominalpublic abstract boolean isNominal()Tests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute.- Returns:
- (undocumented)
 
- 
toMetadataConverts to ML metadata with some existing metadata.
- 
toMetadataConverts to ML metadata
- 
toStructFieldConverts to aStructFieldwith some existing metadata.- Parameters:
- existingMetadata- existing metadata to carry over
- Returns:
- (undocumented)
 
- 
toStructFieldConverts to aStructField.- Returns:
- (undocumented)
 
- 
toString
 
-