Package org.apache.spark.ml.attribute
Class BinaryAttribute
Object
org.apache.spark.ml.attribute.Attribute
org.apache.spark.ml.attribute.BinaryAttribute
- All Implemented Interfaces:
- Serializable
A binary attribute.
 param:  name optional name
 param:  index optional index
 param:  values optional values. If set, its size must be 2.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionattrType()Attribute type.static final BinaryAttributeThe default binary attribute.booleanstatic AttributefromStructField(StructField field) inthashCode()scala.Option<Object>index()Index of the attribute.booleanTests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute.booleanTests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute.scala.Option<String>name()Name of the attribute.scala.Option<String[]>values()withIndex(int index) Copy with a new index.Copy with a new name.Copy without the index.Copy without the name.Copy without the values.withValues(String negative, String positive) Copy with new values.Methods inherited from class org.apache.spark.ml.attribute.AttributetoMetadata, toMetadata, toString, toStructField, toStructField
- 
Method Details- 
defaultAttrThe default binary attribute.
- 
fromStructField
- 
nameDescription copied from class:AttributeName of the attribute. None if it is not set.
- 
indexDescription copied from class:AttributeIndex of the attribute. None if it is not set.
- 
values
- 
attrTypeDescription copied from class:AttributeAttribute type.
- 
isNumericpublic boolean isNumeric()Description copied from class:AttributeTests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute.
- 
isNominalpublic boolean isNominal()Description copied from class:AttributeTests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute.
- 
withNameDescription copied from class:AttributeCopy with a new name.
- 
withoutNameDescription copied from class:AttributeCopy without the name.- Specified by:
- withoutNamein class- Attribute
 
- 
withIndexDescription copied from class:AttributeCopy with a new index.
- 
withoutIndexDescription copied from class:AttributeCopy without the index.- Specified by:
- withoutIndexin class- Attribute
 
- 
withValuesCopy with new values.- Parameters:
- negative- name for negative
- positive- name for positive
- Returns:
- (undocumented)
 
- 
withoutValuesCopy without the values.
- 
equals
- 
hashCodepublic int hashCode()
 
-