Package org.apache.spark.ml.attribute
Class NumericAttribute
Object
org.apache.spark.ml.attribute.Attribute
org.apache.spark.ml.attribute.NumericAttribute
- All Implemented Interfaces:
Serializable
A numeric attribute with optional summary statistics.
param: name optional name
param: index optional index
param: min optional min value
param: max optional max value
param: std optional standard deviation
param: sparsity optional sparsity (ratio of zeros)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionattrType()
Attribute type.static NumericAttribute
The default numeric 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<Object>
max()
scala.Option<Object>
min()
scala.Option<String>
name()
Name of the attribute.scala.Option<Object>
sparsity()
scala.Option<Object>
std()
withIndex
(int index) Copy with a new index.withMax
(double max) Copy with a new max value.withMin
(double min) Copy with a new min value.Copy with a new name.Copy without the index.Copy without the max value.Copy without the min value.Copy without the name.Copy without the sparsity.Copy without the standard deviation.Copy without summary statistics.withSparsity
(double sparsity) Copy with a new sparsity.withStd
(double std) Copy with a new standard deviation.Methods inherited from class org.apache.spark.ml.attribute.Attribute
toMetadata, toMetadata, toString, toStructField, toStructField
-
Method Details
-
defaultAttr
The default numeric 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. -
min
-
max
-
std
-
sparsity
-
attrType
Description copied from class:Attribute
Attribute type. -
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
-
withMin
Copy with a new min value. -
withoutMin
Copy without the min value. -
withMax
Copy with a new max value. -
withoutMax
Copy without the max value. -
withStd
Copy with a new standard deviation. -
withoutStd
Copy without the standard deviation. -
withSparsity
Copy with a new sparsity. -
withoutSparsity
Copy without the sparsity. -
withoutSummary
Copy without summary statistics. -
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
. -
equals
-
hashCode
public int hashCode()
-