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
,scala.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 BinaryAttribute
The default binary attribute.boolean
static Attribute
fromStructField
(StructField field) int
hashCode()
scala.Option<Object>
index()
Index of the attribute.boolean
Tests whether this attribute is nominal, true forNominalAttribute
andBinaryAttribute
.boolean
Tests whether this attribute is numeric, true forNumericAttribute
andBinaryAttribute
.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:Attribute
Name of the attribute. None if it is not set. -
index
Description copied from class:Attribute
Index of the attribute. None if it is not set. -
values
-
attrType
Description copied from class:Attribute
Attribute type. -
isNumeric
public boolean isNumeric()Description copied from class:Attribute
Tests whether this attribute is numeric, true forNumericAttribute
andBinaryAttribute
. -
isNominal
public boolean isNominal()Description copied from class:Attribute
Tests whether this attribute is nominal, true forNominalAttribute
andBinaryAttribute
. -
withName
Description copied from class:Attribute
Copy with a new name. -
withoutName
Description copied from class:Attribute
Copy without the name.- Specified by:
withoutName
in classAttribute
-
withIndex
Description copied from class:Attribute
Copy with a new index. -
withoutIndex
Description copied from class:Attribute
Copy without the index.- Specified by:
withoutIndex
in 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()
-