weka.classifiers.meta.multisearch
Class PerformanceCache

java.lang.Object
  extended by weka.classifiers.meta.multisearch.PerformanceCache
All Implemented Interfaces:
Serializable

public class PerformanceCache
extends Object
implements Serializable

Represents a simple cache for performance objects.

Version:
$Revision: 5156 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  Hashtable<String,Performance> m_Cache
          the cache for points in the space that got calculated.
 
Constructor Summary
PerformanceCache()
           
 
Method Summary
 void add(int cv, Performance p)
          adds the performance to the cache.
 Performance get(int cv, Point<Object> values)
          returns a cached performance object, null if not yet in the cache.
protected  String getID(int cv, Point<Object> values)
          returns the ID string for a cache item.
 boolean isCached(int cv, Point<Object> values)
          checks whether the point was already calculated once.
 String toString()
          returns a string representation of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Cache

protected Hashtable<String,Performance> m_Cache
the cache for points in the space that got calculated.

Constructor Detail

PerformanceCache

public PerformanceCache()
Method Detail

getID

protected String getID(int cv,
                       Point<Object> values)
returns the ID string for a cache item.

Parameters:
cv - the number of folds in the cross-validation
values - the point in the space
Returns:
the ID string

isCached

public boolean isCached(int cv,
                        Point<Object> values)
checks whether the point was already calculated once.

Parameters:
cv - the number of folds in the cross-validation
values - the point in the space
Returns:
true if the value is already cached

get

public Performance get(int cv,
                       Point<Object> values)
returns a cached performance object, null if not yet in the cache.

Parameters:
cv - the number of folds in the cross-validation
values - the point in the space
Returns:
the cached performance item, null if not in cache

add

public void add(int cv,
                Performance p)
adds the performance to the cache.

Parameters:
cv - the number of folds in the cross-validation
p - the performance object to store

toString

public String toString()
returns a string representation of the cache.

Overrides:
toString in class Object
Returns:
the string representation of the cache


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.