|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.learn.Lexicon.PruningPolicy
public static class Lexicon.PruningPolicy
Represents the feature counting policy of a lexicon. Objects of this type are used to identify and describe a desired pruning policy. In particular, the description of a pruning policy includes feature count thresholds which sometimes need to be computed in terms of data. Space is allocated within objects of this type for storing these thresholds whenever they are computed.
The three pruning policies are described below.
- None
- No pruning is performed.
- Absolute
- Features whose counts within a given dataset fall below an absolute threshold are pruned from that dataset.
- Percentage
- Features whose counts within a given dataset are lower than a given percentage of the most common feature's count are pruned from that dataset.
| Field Summary | |
|---|---|
static int |
ABSOLUTE
Represents pruning with an absolute threshold. |
private int |
index
Can be used to index the names array. |
private static java.lang.String[] |
names
The names of the different counting policies as strings. |
static int |
NONE
Represents no pruning. |
private double |
percentage
The percentage associated with the "Percentage" policy described above. |
static int |
PERCENTAGE
Represents pruning with a percentage threshold. |
private int[] |
thresholds
Feature count thresholds which may either be specified by the policy explicitly or computed in terms of data. |
| Constructor Summary | |
|---|---|
Lexicon.PruningPolicy()
Creates a new pruning policy in which no features will be pruned. |
|
Lexicon.PruningPolicy(double p)
Creates a new "Percentage" policy with the given percentage. |
|
Lexicon.PruningPolicy(int t)
Creates a new "Absolute" policy with the given threshold. |
|
| Method Summary | |
|---|---|
double |
getPercentage()
Returns the value of percentage. |
int |
getThreshold(int i)
Returns the value of the ith threshold in
thresholds when in "Percentage" mode, but ignores the
parameter i and returns the first element of
thresholds when in "Absolute" mode. |
boolean |
isAbsolute()
true iff the policy is absolute thresholding. |
boolean |
isNone()
true iff the policy is no pruning. |
boolean |
isPercentage()
true iff the policy is percentage thresholding. |
void |
setThresholds(int[] t)
Use this method to establish feature count thresholds in the "Percentage" policy. |
java.lang.String |
toString()
Retrieves the name of the policy represented by this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int ABSOLUTE
public static final int PERCENTAGE
private static final java.lang.String[] names
private int index
names array.
private double percentage
private int[] thresholds
| Constructor Detail |
|---|
public Lexicon.PruningPolicy()
public Lexicon.PruningPolicy(double p)
p - The percentage.public Lexicon.PruningPolicy(int t)
t - The threshold.| Method Detail |
|---|
public boolean isNone()
true iff the policy is no pruning.
public boolean isAbsolute()
true iff the policy is absolute thresholding.
public boolean isPercentage()
true iff the policy is percentage thresholding.
public void setThresholds(int[] t)
t - The new feature count thresholds.public int getThreshold(int i)
ith threshold in
thresholds when in "Percentage" mode, but ignores the
parameter i and returns the first element of
thresholds when in "Absolute" mode.
i - An index.
public double getPercentage()
percentage.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||