Class EvaluationResult

All Implemented Interfaces:
KeyValuePair<String,String>, Exportable, Persistent, Serializable, Cloneable

public class EvaluationResult extends ExportablePersistentObject
This class is used to store the result of the evaluation of classification model.
See Also:
  • Constructor Details

    • EvaluationResult

      public EvaluationResult(Persistent belongsTo, Duration duration, int amountOfData, double accuracy, String confusionMatrix, String additionalInfos)
      Creates a new evaluation result of classification model.
      Parameters:
      belongsTo - a Persistent representing the model to which this result belongs to
      duration - the duration (in seconds) for calculating this result
      amountOfData - the number of data records used for calculation this result
      accuracy - the accuracy of the model (as value between 0 and 1)
      confusionMatrix - the confusion matrix for the data of this result
      additionalInfos - additional information about the result; may vary depending on the used evaluation implementation
    • EvaluationResult

      public EvaluationResult()
      Creates an empty evaluation result object
  • Method Details

    • getTableName

      public String getTableName()
      Description copied from interface: Persistent
      This method must return the table name of the database table in which this persistent object is stored.
      Returns:
      The table name of the database table in which this persistent object is stored.
    • belongsTo

      public Persistent belongsTo()
      Returns the representative of the model to which this result belongs to
      Returns:
      the representative of the model to which this result belongs to
    • createdAt

      public Date createdAt()
      Returns the date when this result was created
      Returns:
      the date when this result was created
    • duration

      public long duration()
      Returns how long it took (in seconds) for calculating this result
      Returns:
      the duration (in seconds) for calculating this result
    • amountOfData

      public int amountOfData()
      Returns the number of data records used for calculation this result
      Returns:
      the number of data records used for calculation this result
    • accuracy

      public double accuracy()
      Returns the accuracy (as value between 0 and 1) of the model, i.e. how well the model performs in predicting the correct result.
      Returns:
      the accuracy of the model
    • confusionMatrix

      public String confusionMatrix()
      Returns the confusion matrix for the data of this result. A confusion matrix shows for all classes how many records of a given class have been predicted to be a member of one of the available classes.
      Returns:
      string representation of the confusion matrix
    • additionalInfos

      public String additionalInfos()
      Returns additional information about the result. It content will vary depending on the evaluation implementation used to create this evaluation result.
      Returns:
      a string representation of additional information about the result
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKeys

      public String[][] getKeys()
      Description copied from interface: Persistent
      A class may return key field groups in order to identify already existing objects of that class. A key field group must uniquely identify an object. Multiple such key field groups can be defined. Each of the key field groups must be unique for an object to be unique (thus, group1 matches OR group2 matches etc.).

      The first key field group is occasionally treated in a special manner as the primary business key. E.g. the export import functionality checks for object existence according to just the first key field group.

      If no key field groups can be provided by the implementing class an empty result must be returned - use Persistent.emptyKeys to do so.

      Specified by:
      getKeys in interface Persistent
      Overrides:
      getKeys in class PersistentObject
      Returns:
      An array of arrays containing object field names of those fields which constitute key field groups for uniquely identifying objects of classes implementing this interface. An example would be {{"name", "birthdate"},{"ssn"}} for a class defining two key field groups. The first one contains the fields name and birthdate, the second key field group has just one field ssn.
    • getLocalObjectName

      public String getLocalObjectName()
      Description copied from class: PersistentObject
      Get the object name in localized form. Subclasses should override this method!
      Specified by:
      getLocalObjectName in interface Persistent
      Overrides:
      getLocalObjectName in class PersistentObject
      Returns:
      the name of the objects in localized form
    • getLocalClassName

      public String getLocalClassName()
      Specified by:
      getLocalClassName in interface Persistent
      Overrides:
      getLocalClassName in class PersistentObject
      Returns:
      the name of the class in localized form. Subclasses should override this method!