cc.mallet.types
Class FeatureSelection
java.lang.Object
cc.mallet.types.FeatureSelection
- All Implemented Interfaces:
- AlphabetCarrying, java.io.Serializable
public class FeatureSelection
- extends java.lang.Object
- implements AlphabetCarrying, java.io.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FeatureSelection
public FeatureSelection(Alphabet dictionary,
java.util.BitSet selectedFeatures)
FeatureSelection
public FeatureSelection(Alphabet dictionary)
FeatureSelection
public FeatureSelection(RankedFeatureVector rsv,
int numFeatures)
createFromRegex
public static FeatureSelection createFromRegex(Alphabet dictionary,
java.util.regex.Pattern regex)
- Creates a FeatureSelection that includes only those features whose names match a given regex.
A static factory method.
- Parameters:
dictionary
- A dictionary of fetaure names. Entries must be string.regex
- Features whose names match this pattern will be included.
- Returns:
- A new FeatureSelection.
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object
getAlphabet
public Alphabet getAlphabet()
- Specified by:
getAlphabet
in interface AlphabetCarrying
getAlphabets
public Alphabet[] getAlphabets()
- Specified by:
getAlphabets
in interface AlphabetCarrying
cardinality
public int cardinality()
getBitSet
public java.util.BitSet getBitSet()
add
public void add(java.lang.Object o)
add
public void add(int index)
remove
public void remove(java.lang.Object o)
remove
public void remove(int index)
contains
public boolean contains(java.lang.Object o)
contains
public boolean contains(int index)
or
public void or(FeatureSelection fs)
nextSelectedIndex
public int nextSelectedIndex(int index)
nextDeselectedIndex
public int nextDeselectedIndex(int index)