edu.uiuc.ge.illigal.gale.agents
Class BatchPerformance

java.lang.Object
  |
  +--edu.uiuc.ge.illigal.gale.agents.BatchPerformance
All Implemented Interfaces:
AgentPerformance, java.lang.Cloneable, java.io.Serializable

public class BatchPerformance
extends java.lang.Object
implements AgentPerformance, java.io.Serializable, java.lang.Cloneable

Implements the AgentPerformance for batch learning.

Since:
0.9alpha
Version:
0.9alpha
Author:
Xavier Llorà <xllora@illigal.ge.uiuc.edu>
See Also:
Serialized Form

Field Summary
protected  int iCls
          Number of classes
protected  int iDontKnow
          Number of unclassified classified instances
protected  int[][] imConfusion
          Confusion matrix
protected  int iTotal
          Number of classified instances
 
Constructor Summary
BatchPerformance(edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf)
          Initializes the performance object using the given configuration.
 
Method Summary
 java.lang.Object clone()
          Clones the current IncrementalLearning Performance object.
 boolean equals(java.lang.Object obj)
          Compares if the performances are equal
 float getAccuracy()
          Provides the overall classification performance information.
 int[][] getConfusionMatrix()
          Returns the confusion matrix.
 int getDontKnow()
          Returns the total number of unclassified instances
 float getScaledAccuracy()
          Provides the overall classification performance information.
 int getTotal()
          Returns the total number of classified instances
 void reset()
          Resets all the performance information contained.
 java.lang.String toString()
          Converts the information into a string
 void update(int iCls, int iReal)
          Updates the performance information.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

imConfusion

protected int[][] imConfusion
Confusion matrix


iDontKnow

protected int iDontKnow
Number of unclassified classified instances


iTotal

protected int iTotal
Number of classified instances


iCls

protected int iCls
Number of classes

Constructor Detail

BatchPerformance

public BatchPerformance(edu.uiuc.ge.illigal.gale.config.GALEConfiguration galeCnf)
Initializes the performance object using the given configuration.

Parameters:
galeCnf - The GALE environment configuration
Method Detail

getConfusionMatrix

public int[][] getConfusionMatrix()
Description copied from interface: AgentPerformance
Returns the confusion matrix.

Specified by:
getConfusionMatrix in interface AgentPerformance
Returns:
The confusion matrix

getDontKnow

public int getDontKnow()
Description copied from interface: AgentPerformance
Returns the total number of unclassified instances

Specified by:
getDontKnow in interface AgentPerformance
Returns:
The number of unclassified instances processes

getTotal

public int getTotal()
Description copied from interface: AgentPerformance
Returns the total number of classified instances

Specified by:
getTotal in interface AgentPerformance
Returns:
The number of instances processes

getAccuracy

public float getAccuracy()
Description copied from interface: AgentPerformance
Provides the overall classification performance information. Computes the classification performance since the last reset of Agent.

Specified by:
getAccuracy in interface AgentPerformance
Returns:
The classification performance

getScaledAccuracy

public float getScaledAccuracy()
Description copied from interface: AgentPerformance
Provides the overall classification performance information. Computes the classification performance since the last reset of Agent.

Specified by:
getScaledAccuracy in interface AgentPerformance
Returns:
The classification performance

update

public void update(int iCls,
                   int iReal)
Description copied from interface: AgentPerformance
Updates the performance information. It needs the predicted class and the real class for the prediction.

Specified by:
update in interface AgentPerformance
Parameters:
iCls - The predicted class
iReal - The real class

reset

public void reset()
Description copied from interface: AgentPerformance
Resets all the performance information contained.

Specified by:
reset in interface AgentPerformance

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: AgentPerformance
Compares if the performances are equal

Specified by:
equals in interface AgentPerformance
Overrides:
equals in class java.lang.Object
Parameters:
obj - the performance to be compared with
Returns:
true if the performance are equal

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: AgentPerformance
Clones the current IncrementalLearning Performance object.

Specified by:
clone in interface AgentPerformance
Overrides:
clone in class java.lang.Object
Returns:
The cloned object
Throws:
java.lang.CloneNotSupportedException - The object could not be cloned

toString

public java.lang.String toString()
Description copied from interface: AgentPerformance
Converts the information into a string

Specified by:
toString in interface AgentPerformance
Overrides:
toString in class java.lang.Object
Returns:
The stringfied information