|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.ml.attribute.AttributeGroup
public class AttributeGroup
:: DeveloperApi :: 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.
Constructor Summary | |
---|---|
AttributeGroup(String name)
Creates an attribute group without attribute info. |
|
AttributeGroup(String name,
Attribute[] attrs)
Creates an attribute group with attributes. |
|
AttributeGroup(String name,
int numAttributes)
Creates an attribute group knowing only the number of attributes. |
Method Summary | |
---|---|
Attribute |
apply(int attrIndex)
Gets an attribute by its index. |
Attribute |
apply(String attrName)
Gets an attribute by its name. |
scala.Option<Attribute[]> |
attributes()
Optional array of attributes. |
boolean |
equals(Object other)
|
static AttributeGroup |
fromStructField(StructField field)
Creates an attribute group from a StructField instance. |
Attribute |
getAttr(int attrIndex)
Gets an attribute by its index. |
Attribute |
getAttr(String attrName)
Gets an attribute by its name. |
boolean |
hasAttr(String attrName)
Test whether this attribute group contains a specific attribute. |
int |
hashCode()
|
int |
indexOf(String attrName)
Index of an attribute specified by name. |
String |
name()
|
scala.Option<Object> |
numAttributes()
|
int |
size()
Size of the attribute group. |
Metadata |
toMetadata()
Converts to ML metadata |
Metadata |
toMetadata(Metadata existingMetadata)
Converts to ML metadata with some existing metadata. |
StructField |
toStructField()
Converts to a StructField. |
StructField |
toStructField(Metadata existingMetadata)
Converts to a StructField with some existing metadata. |
Methods inherited from class Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeGroup(String name)
name
- name of the attribute grouppublic AttributeGroup(String name, int numAttributes)
name
- name of the attribute groupnumAttributes
- number of attributespublic AttributeGroup(String name, Attribute[] attrs)
name
- name of the attribute groupattrs
- array of attributes. Attributes will be copied with their corresponding indices in
the array.Method Detail |
---|
public static AttributeGroup fromStructField(StructField field)
StructField
instance.
public String name()
public scala.Option<Object> numAttributes()
public scala.Option<Attribute[]> attributes()
numAttributes
and attributes
can be defined.
public int size()
public boolean hasAttr(String attrName)
public int indexOf(String attrName)
public Attribute apply(String attrName)
public Attribute getAttr(String attrName)
public Attribute apply(int attrIndex)
public Attribute getAttr(int attrIndex)
public Metadata toMetadata(Metadata existingMetadata)
public Metadata toMetadata()
public StructField toStructField(Metadata existingMetadata)
public StructField toStructField()
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |