org.apache.spark.ml.attribute
Class NumericAttribute

Object
  extended by org.apache.spark.ml.attribute.Attribute
      extended by org.apache.spark.ml.attribute.NumericAttribute
All Implemented Interfaces:
java.io.Serializable

public class NumericAttribute
extends Attribute

:: DeveloperApi :: 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:
Serialized Form

Method Summary
 AttributeType attrType()
          Attribute type.
static NumericAttribute defaultAttr()
          The default numeric attribute.
 boolean equals(Object other)
           
 int hashCode()
           
 scala.Option<Object> index()
          Index of the attribute.
 boolean isNominal()
          Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.
 boolean isNumeric()
          Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.
 scala.Option<Object> max()
           
 scala.Option<Object> min()
           
 scala.Option<String> name()
          Name of the attribute.
 scala.Option<Object> sparsity()
           
 scala.Option<Object> std()
           
 NumericAttribute withIndex(int index)
          Copy with a new index.
 NumericAttribute withMax(double max)
          Copy with a new max value.
 NumericAttribute withMin(double min)
          Copy with a new min value.
 NumericAttribute withName(String name)
          Copy with a new name.
 NumericAttribute withoutIndex()
          Copy without the index.
 NumericAttribute withoutMax()
          Copy without the max value.
 NumericAttribute withoutMin()
          Copy without the min value.
 NumericAttribute withoutName()
          Copy without the name.
 NumericAttribute withoutSparsity()
          Copy without the sparsity.
 NumericAttribute withoutStd()
          Copy without the standard deviation.
 NumericAttribute withoutSummary()
          Copy without summary statistics.
 NumericAttribute withSparsity(double sparsity)
          Copy with a new sparsity.
 NumericAttribute withStd(double std)
          Copy with a new standard deviation.
 
Methods inherited from class org.apache.spark.ml.attribute.Attribute
toMetadata, toMetadata, toString, toStructField, toStructField
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

defaultAttr

public static NumericAttribute defaultAttr()
The default numeric attribute.


name

public scala.Option<String> name()
Description copied from class: Attribute
Name of the attribute. None if it is not set.

Specified by:
name in class Attribute

index

public scala.Option<Object> index()
Description copied from class: Attribute
Index of the attribute. None if it is not set.

Specified by:
index in class Attribute

min

public scala.Option<Object> min()

max

public scala.Option<Object> max()

std

public scala.Option<Object> std()

sparsity

public scala.Option<Object> sparsity()

attrType

public AttributeType attrType()
Description copied from class: Attribute
Attribute type.

Specified by:
attrType in class Attribute

withName

public NumericAttribute withName(String name)
Description copied from class: Attribute
Copy with a new name.

Specified by:
withName in class Attribute

withoutName

public NumericAttribute withoutName()
Description copied from class: Attribute
Copy without the name.

Specified by:
withoutName in class Attribute

withIndex

public NumericAttribute withIndex(int index)
Description copied from class: Attribute
Copy with a new index.

Specified by:
withIndex in class Attribute

withoutIndex

public NumericAttribute withoutIndex()
Description copied from class: Attribute
Copy without the index.

Specified by:
withoutIndex in class Attribute

withMin

public NumericAttribute withMin(double min)
Copy with a new min value.


withoutMin

public NumericAttribute withoutMin()
Copy without the min value.


withMax

public NumericAttribute withMax(double max)
Copy with a new max value.


withoutMax

public NumericAttribute withoutMax()
Copy without the max value.


withStd

public NumericAttribute withStd(double std)
Copy with a new standard deviation.


withoutStd

public NumericAttribute withoutStd()
Copy without the standard deviation.


withSparsity

public NumericAttribute withSparsity(double sparsity)
Copy with a new sparsity.


withoutSparsity

public NumericAttribute withoutSparsity()
Copy without the sparsity.


withoutSummary

public NumericAttribute withoutSummary()
Copy without summary statistics.


isNumeric

public boolean isNumeric()
Description copied from class: Attribute
Tests whether this attribute is numeric, true for NumericAttribute and BinaryAttribute.

Specified by:
isNumeric in class Attribute
Returns:
(undocumented)

isNominal

public boolean isNominal()
Description copied from class: Attribute
Tests whether this attribute is nominal, true for NominalAttribute and BinaryAttribute.

Specified by:
isNominal in class Attribute
Returns:
(undocumented)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object