Package org.tribuo
Class MutableFeatureMap
java.lang.Object
org.tribuo.FeatureMap
org.tribuo.MutableFeatureMap
- All Implemented Interfaces:
Serializable
,Iterable<VariableInfo>
A feature map that can record new feature value observations.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.FeatureMap
m
-
Constructor Summary
ConstructorDescriptionCreates an empty feature map which converts high cardinality categorical variable infos into reals.MutableFeatureMap
(boolean convertHighCardinality) Creates an empty feature map which can optionally convert high cardinality categorical variable infos into reals. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an occurrence of a feature with a given name.void
clear()
Clears all the feature observations.put
(VariableInfo info) Adds a variable info into the feature map.Methods inherited from class org.tribuo.FeatureMap
domainEquals, get, iterator, keySet, size, toReadableString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MutableFeatureMap
public MutableFeatureMap()Creates an empty feature map which converts high cardinality categorical variable infos into reals.The conversion threshold is
CategoricalInfo.THRESHOLD
. -
MutableFeatureMap
public MutableFeatureMap(boolean convertHighCardinality) Creates an empty feature map which can optionally convert high cardinality categorical variable infos into reals.The conversion threshold is
CategoricalInfo.THRESHOLD
.- Parameters:
convertHighCardinality
- Should this feature map convert high cardinality categorical variables into real variables?
-
-
Method Details
-
put
Adds a variable info into the feature map.Returns the old one if there was a name collision, otherwise returns null.
- Parameters:
info
- The info to add.- Returns:
- The old variable info or null.
-
add
Adds an occurrence of a feature with a given name.- Parameters:
name
- the name of the feature.value
- the observed value of that feature.
-
clear
public void clear()Clears all the feature observations.
-