类 LiteralSet
java.lang.Object
weka.associations.tertius.LiteralSet
- 所有已实现的接口:
Serializable
,Cloneable
,RevisionHandler
Class representing a set of literals, being either the body or the head
of a rule.
- 版本:
- $Revision: 1.7 $
- 作者:
- Amelie Deltour
- 另请参阅:
-
构造器概要
构造器构造器说明Constructor for a set that does not store its counter-instances.LiteralSet
(Instances instances) Constructor initializing the set of counter-instances to all the instances. -
方法概要
修饰符和类型方法说明void
addElement
(Literal element) Add a Literal to this set.abstract boolean
Test if an instance can be kept as a counter-instance, given a new literal.clone()
Returns a shallow copy of this set.boolean
Test if this LiteralSet contains a given Literal.boolean
counterInstance
(Instance instance) Test if an instance is a counter-instance of this LiteralSet.boolean
counterInstance
(Instance individual, Instance part) Test if an individual instance, given a part instance of this individual, is a counter-instance of this LiteralSet.final Iterator
Enumerate the literals contained in this set.double
Get the frequency of counter-instances of this LiteralSet in the data.int
Get the number of counter-instances of this LiteralSet.Give the last literal added to this set.int
getType()
Give the type of properties in this set (individual or part properties).boolean
Test if all the intances are counter-instances.final boolean
isEmpty()
Test if this set is empty.abstract boolean
isIncludedIn
(Rule otherRule) Test if this LiteralSet is included in a rule.boolean
negationIncludedIn
(LiteralSet otherSet) Test if the negation of this LiteralSet is included in another LiteralSet.final int
Give the number of literals in this set.boolean
overFrequencyThreshold
(double minFrequency) Test if this LiteralSet has more counter-instances than the threshold.abstract String
toString()
Gives a String representation for this set of literals.void
Update the number of counter-instances of this set in the dataset.从接口继承的方法 weka.core.RevisionHandler
getRevision
-
构造器详细资料
-
LiteralSet
public LiteralSet()Constructor for a set that does not store its counter-instances. -
LiteralSet
Constructor initializing the set of counter-instances to all the instances.- 参数:
instances
- The dataset.
-
-
方法详细资料
-
clone
Returns a shallow copy of this set. The structured is copied but the literals themselves are not copied.- 返回:
- A copy of this LiteralSet.
-
upDate
Update the number of counter-instances of this set in the dataset. This method should be used is the set does not store its counter-instances.- 参数:
instances
- The dataset.
-
getCounterInstancesNumber
public int getCounterInstancesNumber()Get the number of counter-instances of this LiteralSet.- 返回:
- The number of counter-instances.
-
getCounterInstancesFrequency
public double getCounterInstancesFrequency()Get the frequency of counter-instances of this LiteralSet in the data.- 返回:
- The frequency of counter-instances.
-
overFrequencyThreshold
public boolean overFrequencyThreshold(double minFrequency) Test if this LiteralSet has more counter-instances than the threshold.- 参数:
minFrequency
- The frequency threshold.- 返回:
- True if there are more counter-instances than the threshold.
-
hasMaxCounterInstances
public boolean hasMaxCounterInstances()Test if all the intances are counter-instances.- 返回:
- True if all the instances are counter-instances.
-
addElement
Add a Literal to this set.- 参数:
element
- The element to add.
-
isEmpty
public final boolean isEmpty()Test if this set is empty.- 返回:
- True if the set is empty.
-
numLiterals
public final int numLiterals()Give the number of literals in this set.- 返回:
- The number of literals.
-
enumerateLiterals
Enumerate the literals contained in this set.- 返回:
- An Iterator for the literals.
-
getLastLiteral
Give the last literal added to this set.- 返回:
- The last literal added.
-
negationIncludedIn
Test if the negation of this LiteralSet is included in another LiteralSet.- 参数:
otherSet
- The other LiteralSet.- 返回:
- True if the negation of this LiteralSet is included in the other LiteralSet.
-
contains
Test if this LiteralSet contains a given Literal.- 参数:
lit
- The literal that is looked for.- 返回:
- True if this literal is contained in this LiteralSet.
-
getType
public int getType()Give the type of properties in this set (individual or part properties). -
counterInstance
Test if an individual instance, given a part instance of this individual, is a counter-instance of this LiteralSet.- 参数:
individual
- The individual instance.part
- The part instance.- 返回:
- True if the individual is a counter-instance.
-
counterInstance
Test if an instance is a counter-instance of this LiteralSet.- 参数:
instance
- The instance to test.- 返回:
- True if the instance is a counter-instance.
-
canKeep
Test if an instance can be kept as a counter-instance, given a new literal.- 参数:
instance
- The instance to test.newLit
- The new literal.- 返回:
- True if the instance is still a counter-instance.
-
isIncludedIn
Test if this LiteralSet is included in a rule.- 参数:
otherRule
- The rule to test.- 返回:
- True if this set of literals is included in the rule.
-
toString
Gives a String representation for this set of literals.
-