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 NumericAttributeThe default numeric 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<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: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. -
min
-
max
-
std
-
sparsity
-
attrType
Description copied from class:AttributeAttribute type. -
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
-
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:AttributeTests whether this attribute is numeric, true forNumericAttributeandBinaryAttribute. -
isNominal
public boolean isNominal()Description copied from class:AttributeTests whether this attribute is nominal, true forNominalAttributeandBinaryAttribute. -
equals
-
hashCode
public int hashCode()
-