public class PruneNodeLowerThanThreshold extends NodeToBePrunedCheckerAbstractClass
weightfield
(default value "weight") is lower than threshold
.
Nodes which do not have a weight are given a default value defaultWeightValue
.
Depending on the value of boolean variable avoidOrphans
, a node
is never removed if it has descendants which are not removed (avoidOrphans==true).Modifier and Type | Class and Description |
---|---|
static class |
PruneNodeLowerThanThreshold.nodeComparisonOperator |
Modifier and Type | Field and Description |
---|---|
protected boolean |
avoidOrphans |
protected double |
defaultWeightValue |
protected PruneNodeLowerThanThreshold.nodeComparisonOperator |
nodeComparisonType |
protected double |
threshold |
protected String |
weightField |
Constructor and Description |
---|
PruneNodeLowerThanThreshold(double threshold) |
PruneNodeLowerThanThreshold(double pruningThreshold,
String weightFieldName,
boolean avoidOrphans,
double defaultWeightValue) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkThresholdCondition(TreeNode node) |
String |
describe() |
boolean |
isNodeToBePruned(TreeNode node) |
void |
setComparisonTypeLowerThanAbsoluteValue() |
void |
setComparisonTypeLowerThanValue() |
void |
setDefaultWeightValue(double weightValue) |
initPruner
protected double threshold
protected String weightField
protected boolean avoidOrphans
protected double defaultWeightValue
protected PruneNodeLowerThanThreshold.nodeComparisonOperator nodeComparisonType
public PruneNodeLowerThanThreshold(double pruningThreshold, String weightFieldName, boolean avoidOrphans, double defaultWeightValue)
public PruneNodeLowerThanThreshold(double threshold)
public String describe()
describe
in class NodeToBePrunedCheckerAbstractClass
public boolean isNodeToBePruned(TreeNode node)
isNodeToBePruned
in class NodeToBePrunedCheckerAbstractClass
node
- a TreeNode objectpublic boolean checkThresholdCondition(TreeNode node)
public void setComparisonTypeLowerThanAbsoluteValue()
public void setComparisonTypeLowerThanValue()
public void setDefaultWeightValue(double weightValue)
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.