org.apache.spark.ml.attribute
Class BinaryAttribute

Object
  extended by org.apache.spark.ml.attribute.Attribute
      extended by org.apache.spark.ml.attribute.BinaryAttribute
All Implemented Interfaces:
java.io.Serializable

public class BinaryAttribute
extends Attribute

:: DeveloperApi :: A binary attribute. param: name optional name param: index optional index param: values optionla values. If set, its size must be 2.

See Also:
Serialized Form

Method Summary
 AttributeType attrType()
          Attribute type.
static BinaryAttribute defaultAttr()
          The default binary attribute.
 boolean equals(Object other)
           
 int hashCode()
           
 scala.Option<Object> index()
          Index of the attribute.
 boolean isNominal()
          Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.
 boolean isNumeric()
          Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.
 scala.Option<String> name()
          Name of the attribute.
 scala.Option<String[]> values()
           
 BinaryAttribute withIndex(int index)
          Copy with a new index.
 BinaryAttribute withName(String name)
          Copy with a new name.
 BinaryAttribute withoutIndex()
          Copy without the index.
 BinaryAttribute withoutName()
          Copy without the name.
 BinaryAttribute withoutValues()
          Copy without the values.
 BinaryAttribute withValues(String negative, String positive)
          Copy with new values.
 
Methods inherited from class org.apache.spark.ml.attribute.Attribute
toMetadata, toMetadata, toString, toStructField, toStructField
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

defaultAttr

public static final BinaryAttribute defaultAttr()
The default binary attribute.


name

public scala.Option<String> name()
Description copied from class: Attribute
Name of the attribute. None if it is not set.

Specified by:
name in class Attribute

index

public scala.Option<Object> index()
Description copied from class: Attribute
Index of the attribute. None if it is not set.

Specified by:
index in class Attribute

values

public scala.Option<String[]> values()

attrType

public AttributeType attrType()
Description copied from class: Attribute
Attribute type.

Specified by:
attrType in class Attribute

isNumeric

public boolean isNumeric()
Description copied from class: Attribute
Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.

Specified by:
isNumeric in class Attribute
Returns:
(undocumented)

isNominal

public boolean isNominal()
Description copied from class: Attribute
Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.

Specified by:
isNominal in class Attribute
Returns:
(undocumented)

withName

public BinaryAttribute withName(String name)
Description copied from class: Attribute
Copy with a new name.

Specified by:
withName in class Attribute

withoutName

public BinaryAttribute withoutName()
Description copied from class: Attribute
Copy without the name.

Specified by:
withoutName in class Attribute

withIndex

public BinaryAttribute withIndex(int index)
Description copied from class: Attribute
Copy with a new index.

Specified by:
withIndex in class Attribute

withoutIndex

public BinaryAttribute withoutIndex()
Description copied from class: Attribute
Copy without the index.

Specified by:
withoutIndex in class Attribute

withValues

public BinaryAttribute withValues(String negative,
                                  String positive)
Copy with new values.

Parameters:
negative - name for negative
positive - name for positive
Returns:
(undocumented)

withoutValues

public BinaryAttribute withoutValues()
Copy without the values.


equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object