A collection of related model interfaces that apply to a model.
interface_pairs are a list of ModelInterface instance (test) and class
(ref) pairs, the latter to be instantiated on a model.
Set the debug_mode attribute at any time, or as the optional argument
at initializiation, to ensure that any exceptions that arise from
interacting model interfaces and their features are fully passed back to
the caller of the context containing them.
|
__init__(self,
interface_pairs,
debug_mode=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
reset_weights(self,
old_weights=None)
Reset weights to unity, unless old_weights array is given, in which
case reset to that. |
source code
|
|
|
set_single_feat_weights(self,
feat,
weight=1)
Set weights for a single feature given as an (interface, feature)
pair, setting all others to zero. |
source code
|
|
|
set_weights(self,
weight_dict)
Update weights with a dictionary keyed by test_mi, whose values are
either:
(1) dicts of feature -> scalar weight. |
source code
|
|
|
show_res_info(self,
resvec)
Show detail of feature -> residual mapping for a given residual
vector. |
source code
|
|
|
_map_to_features(self,
x)
Utility to map 1D array x onto the model interface's features with
non-zero weights, returning a dictionary. |
source code
|
|
|
evaluate(self,
model)
Evaluate whole context on a model instance, returning a single
Boolean. |
source code
|
|
|
residual(self,
model,
include_raw=False)
Evaluate whole context on a model instance, returning an array of
residual error between quantitative features in the model trajectory
and their target values. |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|