ResultsDict
- class ResultsDict[source]
Bases:
UserDict
Class for keeping track of results
- __init__(filename, replace=False, lock=True)[source]
initialise empty ResultsDict :param replace: set the replace attribute (default:
False
)
Methods
initialise empty ResultsDict :param replace: set the replace attribute (default:
False
)clear
equivalent to
dim in self['dims']
copy
fromkeys
items
keys
restore results from file
return maximum auc values
pop
If key is not found, d is returned if given, otherwise KeyError is raised.
popitem
as a 2-tuple; but raise KeyError if D is empty.
remove all data for dimensions not in
dims
:param dims: list of dimensions to keepreturn the number of runs
dump contents to json file
setdefault
update
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
update data for given dimension
values
Attributes
replace
if
True
, updates replace existing data, ifFalse
, updates append data- load()[source]
restore results from file
- Parameters:
filename – input json file
replace – set the replace attribute
- Returns:
populated ResultsDict
- update_dim(dim, replace=False, **kwargs)[source]
update data for given dimension
- Parameters:
dim – dimension to update
auc – new auc value
loss – new loss value
args – new args data (optional)
if
self.contains_dim(dim) == True
, behaviour depends on the value ofself.replace
- max(field, dim=None)[source]
return maximum auc values
- Parameters:
field – field to take maximum over
dim – if
dim=None
, return list of values for all dimension, else only return maximum value fordim
.