org.apache.spark.ml.attribute
Class Attribute

Object
  extended by org.apache.spark.ml.attribute.Attribute
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BinaryAttribute, NominalAttribute, NumericAttribute, UnresolvedAttribute

public abstract class Attribute
extends Object
implements scala.Serializable

:: DeveloperApi :: Abstract class for ML attributes.

See Also:
Serialized Form

Constructor Summary
Attribute()
           
 
Method Summary
abstract  AttributeType attrType()
          Attribute type.
abstract  scala.Option<Object> index()
          Index of the attribute.
abstract  boolean isNominal()
          Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.
abstract  boolean isNumeric()
          Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.
abstract  scala.Option<String> name()
          Name of the attribute.
 Metadata toMetadata()
          Converts to ML metadata
 Metadata toMetadata(Metadata existingMetadata)
          Converts to ML metadata with some existing metadata.
 String toString()
           
 StructField toStructField()
          Converts to a StructField.
 StructField toStructField(Metadata existingMetadata)
          Converts to a StructField with some existing metadata.
abstract  Attribute withIndex(int index)
          Copy with a new index.
abstract  Attribute withName(String name)
          Copy with a new name.
abstract  Attribute withoutIndex()
          Copy without the index.
abstract  Attribute withoutName()
          Copy without the name.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute()
Method Detail

attrType

public abstract AttributeType attrType()
Attribute type.


name

public abstract scala.Option<String> name()
Name of the attribute. None if it is not set.


withName

public abstract Attribute withName(String name)
Copy with a new name.


withoutName

public abstract Attribute withoutName()
Copy without the name.


index

public abstract scala.Option<Object> index()
Index of the attribute. None if it is not set.


withIndex

public abstract Attribute withIndex(int index)
Copy with a new index.


withoutIndex

public abstract Attribute withoutIndex()
Copy without the index.


isNumeric

public abstract boolean isNumeric()
Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.

Returns:
(undocumented)

isNominal

public abstract boolean isNominal()
Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.

Returns:
(undocumented)

toMetadata

public Metadata toMetadata(Metadata existingMetadata)
Converts to ML metadata with some existing metadata.


toMetadata

public Metadata toMetadata()
Converts to ML metadata


toStructField

public StructField toStructField(Metadata existingMetadata)
Converts to a StructField with some existing metadata.

Parameters:
existingMetadata - existing metadata to carry over
Returns:
(undocumented)

toStructField

public StructField toStructField()
Converts to a StructField.


toString

public String toString()
Overrides:
toString in class Object