public static class Lexicon.PruningPolicy extends Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
ABSOLUTE
Represents pruning with an absolute threshold.
|
static int |
NONE
Represents no pruning.
|
static int |
PERCENTAGE
Represents pruning with a percentage threshold.
|
Constructor and Description |
---|
PruningPolicy()
Creates a new pruning policy in which no features will be pruned.
|
PruningPolicy(double p)
Creates a new "Percentage" policy with the given percentage.
|
PruningPolicy(int t)
Creates a new "Absolute" policy with the given threshold.
|
Modifier and Type | Method and Description |
---|---|
double |
getPercentage()
Returns the value of
percentage . |
int |
getThreshold(int i)
Returns the value of the
i th 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.
|
String |
toString()
Retrieves the name of the policy represented by this object.
|
public static final int NONE
public static final int ABSOLUTE
public static final int PERCENTAGE
public PruningPolicy()
public PruningPolicy(double p)
p
- The percentage.public PruningPolicy(int t)
t
- The threshold.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)
i
th 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
.Copyright © 2016. All rights reserved.