edu.umass.cs.mallet.base.types
Class FeatureSelection
java.lang.Object
edu.umass.cs.mallet.base.types.FeatureSelection
- All Implemented Interfaces:
- java.io.Serializable
- public class FeatureSelection
- extends java.lang.Object
- implements 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()
getAlphabet
public Alphabet getAlphabet()
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)