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 Summary
Modifier 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.Attribute
toMetadata, toMetadata, toString, toStructField, toStructField 
- 
Method Details
- 
defaultAttr
The default binary attribute. - 
fromStructField
 - 
name
Description copied from class:AttributeName of the attribute. None if it is not set. - 
index
Description copied from class:AttributeIndex of the attribute. None if it is not set. - 
values
 - 
attrType
Description copied from class:AttributeAttribute type. - 
isNumeric
public boolean isNumeric()Description copied from class:AttributeTests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute. - 
isNominal
public boolean isNominal()Description copied from class:AttributeTests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute. - 
withName
Description copied from class:AttributeCopy with a new name. - 
withoutName
Description copied from class:AttributeCopy without the name.- Specified by:
 withoutNamein classAttribute
 - 
withIndex
Description copied from class:AttributeCopy with a new index. - 
withoutIndex
Description copied from class:AttributeCopy without the index.- Specified by:
 withoutIndexin classAttribute
 - 
withValues
Copy with new values.- Parameters:
 negative- name for negativepositive- name for positive- Returns:
 - (undocumented)
 
 - 
withoutValues
Copy without the values. - 
equals
 - 
hashCode
public int hashCode() 
 -