|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectorg.apache.spark.ml.attribute.Attribute
org.apache.spark.ml.attribute.NominalAttribute
public class NominalAttribute
:: DeveloperApi ::
A nominal attribute.
param: name optional name
param: index optional index
param: isOrdinal whether this attribute is ordinal (optional)
param: numValues optional number of values. At most one of numValues and values can be
defined.
param: values optional values. At most one of numValues and values can be defined.
| Method Summary | |
|---|---|
AttributeType |
attrType()
Attribute type. |
static NominalAttribute |
defaultAttr()
The default nominal attribute. |
boolean |
equals(Object other)
|
scala.Option<Object> |
getNumValues()
Get the number of values, either from numValues or from values. |
String |
getValue(int index)
Gets a value given its index. |
int |
hashCode()
|
boolean |
hasValue(String value)
Tests whether this attribute contains a specific value. |
scala.Option<Object> |
index()
Index of the attribute. |
int |
indexOf(String value)
Index of a specific value. |
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> |
isOrdinal()
|
scala.Option<String> |
name()
Name of the attribute. |
scala.Option<Object> |
numValues()
|
scala.Option<String[]> |
values()
|
NominalAttribute |
withIndex(int index)
Copy with a new index. |
NominalAttribute |
withName(String name)
Copy with a new name. |
NominalAttribute |
withNumValues(int numValues)
Copy with a new `numValues` and empty `values`. |
NominalAttribute |
withoutIndex()
Copy without the index. |
NominalAttribute |
withoutName()
Copy without the name. |
NominalAttribute |
withoutNumValues()
Copy without the `numValues`. |
NominalAttribute |
withoutValues()
Copy without the values. |
NominalAttribute |
withValues(String[] values)
Copy with new values and empty `numValues`. |
NominalAttribute |
withValues(String first,
scala.collection.Seq<String> others)
Copy with new values and empty `numValues`. |
NominalAttribute |
withValues(String first,
String... others)
Copy with new values and empty `numValues`. |
| 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 |
|---|
public static final NominalAttribute defaultAttr()
public NominalAttribute withValues(String first,
String... others)
public scala.Option<String> name()
Attribute
name in class Attributepublic scala.Option<Object> index()
Attribute
index in class Attributepublic scala.Option<Object> isOrdinal()
public scala.Option<Object> numValues()
public scala.Option<String[]> values()
public AttributeType attrType()
Attribute
attrType in class Attributepublic boolean isNumeric()
AttributeNumericAttribute and BinaryAttribute.
isNumeric in class Attributepublic boolean isNominal()
AttributeNominalAttribute and BinaryAttribute.
isNominal in class Attributepublic int indexOf(String value)
public boolean hasValue(String value)
public String getValue(int index)
public NominalAttribute withName(String name)
Attribute
withName in class Attributepublic NominalAttribute withoutName()
Attribute
withoutName in class Attributepublic NominalAttribute withIndex(int index)
Attribute
withIndex in class Attributepublic NominalAttribute withoutIndex()
Attribute
withoutIndex in class Attributepublic NominalAttribute withValues(String[] values)
public NominalAttribute withValues(String first,
scala.collection.Seq<String> others)
public NominalAttribute withoutValues()
public NominalAttribute withNumValues(int numValues)
public NominalAttribute withoutNumValues()
public scala.Option<Object> getNumValues()
numValues or from values.
Return None if unknown.
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||