Package org.tribuo
Class Feature
java.lang.Object
org.tribuo.Feature
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Feature>
- Direct Known Subclasses:
ColumnarFeature
A class for features. Features are an immutable tuple of name and a double value.
Features can be manufactured by the Example
and are not expected
to be long lived objects. They may be deconstructed when stored in an Example.
One day they should become value/inline types.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
int
boolean
static Comparator<Feature>
A comparator using the lexicographic ordering of feature names.getName()
Returns the feature name.double
getValue()
Returns the feature value.int
hashCode()
toHTML()
Returns the feature name formatted as a table cell.toString()
-
Field Details
-
name
The feature name. -
value
protected final double valueThe feature value.
-
-
Constructor Details
-
Feature
Creates an immutable feature.- Parameters:
name
- The feature name.value
- The feature value.
-
-
Method Details
-
getName
Returns the feature name.- Returns:
- The feature name
-
getValue
public double getValue()Returns the feature value.- Returns:
- The feature value.
-
toString
-
toHTML
Returns the feature name formatted as a table cell.- Returns:
- The feature name.
-
equals
-
hashCode
public int hashCode() -
clone
-
featureNameComparator
A comparator using the lexicographic ordering of feature names.- Returns:
- A lexicographic comparator.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Feature>
-