|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.Evaluator
public final class Evaluator
Utility class to evaluate rules discovered by ants.
Method Summary | |
---|---|
static java.util.List<Instance> |
filter(java.util.List<Instance> instances,
Term term)
Filters the specified list of instances according to the test represented by the term. |
static java.util.List<Instance> |
findCorrectCases(Rule rule,
Dataset dataset)
Returns the correct covered (the instance class value equals to the specified rule consequent) instances by the specified rule. |
static java.util.List<Instance> |
findCoveredCases(Rule rule,
Dataset dataset)
Returns the covered instances by the specified rule. |
static java.util.List<Instance> |
findCoveredCases(Rule rule,
java.util.List<Instance> instances)
Returns the covered instances by the specified rule. |
static java.util.Set<java.lang.Integer> |
findIndexedCoveredCases(Rule rule,
Dataset dataset)
Returns a set of indexes of the covered instances by the specified rule. |
static java.util.Set<java.lang.Integer> |
findIndexedCoveredCases(Rule rule,
java.util.List<Instance> instances)
Returns a set of indexes of the covered instances by the specified rule. |
static Label |
findMajorityClass(Dataset dataset)
Returns the majority class value among the specified dataset. |
static Label |
findMajorityClass(java.util.List<Instance> instances,
Metadata metadata)
Returns the majority class value among the specified instances. |
static Label |
findMajorityClass(java.util.List<Instance> instances,
Metadata metadata,
Label label)
Returns the majority class value among the specified instances. |
static Label |
findMajorityClassValue(java.util.List<Instance> instances,
int index)
Returns the majority class value among the specified instances. |
static Label |
findMajorityClassValue(java.util.List<Instance> instances,
int index,
Label label)
Returns the majority class value among the specified instances. |
static java.util.List<Instance> |
findNotCoveredCases(Rule rule,
Dataset dataset)
Returns the not covered instances by the specified rule. |
static java.util.List<Instance> |
findNotCoveredCases(Rule rule,
java.util.List<Instance> instances)
Returns the not covered instances by the specified rule. |
static java.util.List<Instance> |
findPositiveCases(Rule rule,
Dataset dataset)
Returns the positive covered (the instance class value contains the specified rule consequent) instances by the specified rule. |
static DefaultConfidenceFactor |
getConfidenceFactor(Rule rule,
Dataset dataset)
Returns the confidence factor of the specified rule when used to classify the dataset instances. |
static ConfusionMatrix |
getConfusionMatrix(Model model,
Dataset dataset)
Returns the confusion matrix of the specified rule set when used to classify the dataset instances. |
static ConfusionMatrix |
getConfusionMatrix(Model model,
Dataset dataset,
java.lang.String label)
Returns the confusion matrix of the model for the specified class label. |
static ConfusionMatrix |
getConfusionMatrix(Rule rule,
Dataset dataset)
Returns the confusion matrix of the specified rule when used to classify the dataset instances. |
static ConfusionMatrix |
getConfusionMatrix(Rule rule,
Dataset dataset,
java.lang.String label)
Returns the confusion matrix of the rule when used to classify the dataset instances, predicting the specified class label. |
static ConfusionMatrix |
getConfusionMatrix(Rule rule,
java.util.List<Instance> instances)
Returns the confusion matrix of the specified rule when used to classify the specified instances. |
static ConfusionMatrix |
getConfusionMatrix(Rule rule,
java.util.List<Instance> instances,
java.lang.String label)
Returns the confusion matrix of the rule when used to classify the specified instances, predicting a class label. |
static ConfusionMatrix |
getConfusionMatrix(Rule rule,
java.util.List<Instance> instances,
UsefulnessHelper helper)
Returns the confusion matrix of the specified rule when used to classify the specified instances. |
static Label |
getPresentLabel(java.util.List<Instance> instances)
Returns a label instance with all present class labels from from the specified instances active. |
static boolean |
sameLabel(java.util.List<Instance> instances)
Verifies if the the list of instances have the same class label. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.List<Instance> findCoveredCases(Rule rule, Dataset dataset)
rule
- the trail to be used as a filter.dataset
- the dataset to get the instances.
public static java.util.List<Instance> findCoveredCases(Rule rule, java.util.List<Instance> instances)
rule
- the trail to be used as a filter.instances
- the instances list to check.
public static java.util.List<Instance> findNotCoveredCases(Rule rule, Dataset dataset)
rule
- the trail to be used as a filter.dataset
- the dataset to get the instances.
public static java.util.List<Instance> findNotCoveredCases(Rule rule, java.util.List<Instance> instances)
rule
- the trail to be used as a filter.instances
- the instances list to check.
public static java.util.Set<java.lang.Integer> findIndexedCoveredCases(Rule rule, Dataset dataset)
rule
- the trail to be used as a filter.dataset
- the dataset to get the instances.
public static java.util.Set<java.lang.Integer> findIndexedCoveredCases(Rule rule, java.util.List<Instance> instances)
rule
- the trail to be used as a filter.instances
- the instances list to check.
public static java.util.List<Instance> findPositiveCases(Rule rule, Dataset dataset)
findCorrectCases(Rule, Dataset)
public static java.util.List<Instance> findCorrectCases(Rule rule, Dataset dataset)
findPositiveCases(Rule, Dataset)
method.
rule
- the rule to be used as a filter.dataset
- the dataset to get the instances.
findPositiveCases(Rule, Dataset)
public static ConfusionMatrix getConfusionMatrix(Rule rule, Dataset dataset)
rule
- the rule to be used in the classification.dataset
- the dataset to get the instances.
public static ConfusionMatrix getConfusionMatrix(Rule rule, java.util.List<Instance> instances)
rule
- the rule to be used in the classification.instances
- the instances to classify.
public static ConfusionMatrix getConfusionMatrix(Rule rule, java.util.List<Instance> instances, UsefulnessHelper helper)
rule
- the rule to be used in the classification.instances
- the instances to classify.
public static ConfusionMatrix getConfusionMatrix(Rule rule, Dataset dataset, java.lang.String label)
rule
- the rule to be used in the classification.dataset
- the dataset to get the instances from.label
- the class label to be used as the prediction. The label
should be present in the consequent of the rule.
public static ConfusionMatrix getConfusionMatrix(Rule rule, java.util.List<Instance> instances, java.lang.String label)
rule
- the rule to be used in the classification.instances
- the instances to classify.label
- the class label to be used as the prediction. The label
should be present in the consequent of the rule.
public static DefaultConfidenceFactor getConfidenceFactor(Rule rule, Dataset dataset)
rule
- the rule to be used in the classification.dataset
- the dataset to get the instances.
public static ConfusionMatrix getConfusionMatrix(Model model, Dataset dataset, java.lang.String label)
model
- the model to be used in the classification.dataset
- the dataset to get the instances.label
- the desired class label.
public static ConfusionMatrix getConfusionMatrix(Model model, Dataset dataset)
model
- the model to be used in the classification.dataset
- the dataset to get the instances.
public static Label findMajorityClassValue(java.util.List<Instance> instances, int index)
instances
- the list of instances.index
- the class attribute index.
public static Label findMajorityClassValue(java.util.List<Instance> instances, int index, Label label)
instances
- the list of instances.index
- the class attribute index.label
- the label returned in case of a tie. Usually this label
will represent the overall majority of the data set.
public static Label findMajorityClass(java.util.List<Instance> instances, Metadata metadata)
instances
- the list of instances.metadata
- the dataset metadata.
public static Label findMajorityClass(java.util.List<Instance> instances, Metadata metadata, Label label)
instances
- the list of instances.metadata
- the dataset metadata.label
- the label returned in case of a tie. Usually this label
will represent the overall majority of the data set.
public static Label findMajorityClass(Dataset dataset)
dataset
- the dataset reference.
public static java.util.List<Instance> filter(java.util.List<Instance> instances, Term term)
instances
- the list of instances to be filtered.term
- the filter criterion.
public static boolean sameLabel(java.util.List<Instance> instances)
instances
- the list of instances to check.
true
of all instances have the same label;
false
otherwise.public static Label getPresentLabel(java.util.List<Instance> instances)
instances
- the list of instances to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |