Package org.apache.spark.ml.attribute
Class AttributeGroup
Object
org.apache.spark.ml.attribute.AttributeGroup
- All Implemented Interfaces:
- Serializable
Attributes that describe a vector ML column.
 
 param:  name name of the attribute group (the ML column name)
 param:  numAttributes optional number of attributes. At most one of numAttributes and attrs
                      can be defined.
 param:  attrs optional array of attributes. Attribute will be copied with their corresponding
              indices in the array.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionAttributeGroup(String name) Creates an attribute group without attribute info.AttributeGroup(String name, int numAttributes) Creates an attribute group knowing only the number of attributes.AttributeGroup(String name, Attribute[] attrs) Creates an attribute group with attributes.
- 
Method SummaryModifier and TypeMethodDescriptionapply(int attrIndex) Gets an attribute by its index.Gets an attribute by its name.scala.Option<Attribute[]>Optional array of attributes.booleanstatic AttributeGroupfromStructField(StructField field) Creates an attribute group from aStructFieldinstance.getAttr(int attrIndex) Gets an attribute by its index.Gets an attribute by its name.booleanTest whether this attribute group contains a specific attribute.inthashCode()intIndex of an attribute specified by name.name()scala.Option<Object>intsize()Size of the attribute group.Converts to ML metadatatoMetadata(Metadata existingMetadata) Converts to ML metadata with some existing metadata.toString()Converts to a StructField.toStructField(Metadata existingMetadata) Converts to a StructField with some existing metadata.
- 
Constructor Details- 
AttributeGroupCreates an attribute group without attribute info.- Parameters:
- name- name of the attribute group
 
- 
AttributeGroupCreates an attribute group knowing only the number of attributes.- Parameters:
- name- name of the attribute group
- numAttributes- number of attributes
 
- 
AttributeGroupCreates an attribute group with attributes.- Parameters:
- name- name of the attribute group
- attrs- array of attributes. Attributes will be copied with their corresponding indices in the array.
 
 
- 
- 
Method Details- 
fromStructFieldCreates an attribute group from aStructFieldinstance.- Parameters:
- field- (undocumented)
- Returns:
- (undocumented)
 
- 
name
- 
numAttributes
- 
attributesOptional array of attributes. At most one ofnumAttributesandattributescan be defined.- Returns:
- (undocumented)
 
- 
sizepublic int size()Size of the attribute group. Returns -1 if the size is unknown.
- 
hasAttrTest whether this attribute group contains a specific attribute.
- 
indexOfIndex of an attribute specified by name.
- 
applyGets an attribute by its name.
- 
getAttrGets an attribute by its name.
- 
applyGets an attribute by its index.
- 
getAttrGets an attribute by its index.
- 
toMetadataConverts to ML metadata with some existing metadata.
- 
toMetadataConverts to ML metadata
- 
toStructFieldConverts to a StructField with some existing metadata.
- 
toStructFieldConverts to a StructField.
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-