|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.tools.math.Averagable
edu.udo.cs.yale.operator.performance.PerformanceCriterion
edu.udo.cs.yale.operator.performance.MeasuredPerformance
edu.udo.cs.yale.operator.performance.SimpleCriterion
public abstract class SimpleCriterion
Simple criteria are those which error can be counted for each example and can
be averaged by the number of examples. The fitness has a reciprocal value of
the error. Subclasses might also want to implement the method
transform(double) which applies a transformation on the value
sum divided by the number of counted examples. This is for example usefull in
case of root_means_squared error. All subclasses can be used for both
regression and classification problems. In case of classification the
confidence value for the desired true label is used as prediction.
| Field Summary | |
|---|---|
private int |
exampleCount
|
private Attribute |
labelAttribute
|
private Attribute |
predictedAttribute
|
private double |
squaresSum
|
private double |
sum
|
| Constructor Summary | |
|---|---|
SimpleCriterion()
|
|
| Method Summary | |
|---|---|
void |
buildSingleAverage(Averagable performance)
This method should build the average of this and another averagables of the same type. |
protected void |
cloneAveragable(Averagable newAvg)
Must be implemented by subclasses such that it copies all values of other to this. |
protected void |
countExample(double deviation)
|
protected abstract double |
countExample(double label,
double predictedLabel)
Subclasses must count the example and return the value to sum up. |
void |
countExample(Example example)
Invokes countExample(double, double) and counts the
deviation. |
int |
getExampleCount()
Returns the number of data points which was used to determine the criterion value. |
double |
getFitness()
Returns the fitness depending on the value. |
double |
getMikroAverage()
Returns the (current) value of the averagable (the average itself). |
double |
getMikroVariance()
Returns the variance of the averagable. |
void |
readCriterionData(java.io.BufferedReader in)
Reads the performance data from the given reader. |
void |
startCounting(ExampleSet eset)
Initialises the criterion. |
protected double |
transform(double value)
Simply returns the given value. |
void |
writeCriterionData(java.io.PrintWriter out)
Writes the performance criterion into the given writer. |
| Methods inherited from class edu.udo.cs.yale.operator.performance.MeasuredPerformance |
|---|
getDescription |
| Methods inherited from class edu.udo.cs.yale.operator.performance.PerformanceCriterion |
|---|
compareTo, getMaxFitness, readPerformanceCriterion, writePerformanceCriterion |
| Methods inherited from class edu.udo.cs.yale.tools.math.Averagable |
|---|
buildAverage, clone, formatDeviation, formatPercent, formatValue, getAverage, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, getName, getStandardDeviation, getVariance, toHTML, toString |
| Methods inherited from class edu.udo.cs.yale.operator.ResultObjectAdapter |
|---|
addAction, getActions, getVisualisationComponent, toHTML, toResultString |
| Methods inherited from class edu.udo.cs.yale.operator.AbstractIOObject |
|---|
copy, read, read, read, write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.udo.cs.yale.operator.IOObject |
|---|
copy, write, write |
| Field Detail |
|---|
private Attribute predictedAttribute
private Attribute labelAttribute
private double sum
private double squaresSum
private int exampleCount
| Constructor Detail |
|---|
public SimpleCriterion()
| Method Detail |
|---|
public void writeCriterionData(java.io.PrintWriter out)
throws java.io.IOException
PerformanceCriterion
writeCriterionData in class PerformanceCriterionjava.io.IOException
public void readCriterionData(java.io.BufferedReader in)
throws java.io.IOException
PerformanceCriterion
readCriterionData in class PerformanceCriterionjava.io.IOExceptionpublic int getExampleCount()
PerformanceCriterion
getExampleCount in class PerformanceCriterionpublic void countExample(Example example)
countExample(double, double) and counts the
deviation. In case of a nominal label the confidence of the desired true
label is used as prediction. For regression problems the usual predicted
label is used.
countExample in class MeasuredPerformance
protected abstract double countExample(double label,
double predictedLabel)
protected double transform(double value)
protected void countExample(double deviation)
public double getMikroAverage()
Averagable
getMikroAverage in class Averagablepublic double getMikroVariance()
Averagable
getMikroVariance in class Averagable
public void startCounting(ExampleSet eset)
throws OperatorException
MeasuredPerformance
startCounting in class MeasuredPerformanceOperatorExceptionpublic double getFitness()
PerformanceCriterion
getFitness in class PerformanceCriterionprotected void cloneAveragable(Averagable newAvg)
Averagableother to this. When this method is called,
it is guaranteed, that other is a subclass of the class of
the object it is called on.
cloneAveragable in class Averagablepublic void buildSingleAverage(Averagable performance)
AveragableSimpleCriterion for a simple
implementation example.
buildSingleAverage in class Averagable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||