biophysics_fittingcombinerCombiner

Combiner

class biophysics_fitting.combiner.Combiner

This class can be used to combine features (usually) computed by an Evaluator object.

For a Simulator object s, an Evaluator object e, and a Combiner object c, the typical usecase is:

>>> voltage_traces_dict = s.run(params)
>>> features = e.evaluate(voltage_traces_dict)
>>> combined_features = c.combine(features)

Internally, the Combiner iterates over all names of specified combinations. Each combination is specified not only by a name of the combination, but also a list of names of the features that go into that combination. Each list of features is then combined by calling combinefun with that list.

Example

>>> features = {'feature1': 1, 'feature2': 2, 'feature3': 3, 'feature4': 4}
>>> c = Combiner()
>>> c.setup.append('combination1', ['feature1', 'feature2'])
>>> c.setup.append('combination2', ['feature2', 'feature3', 'feature4'])
>>> c.setup.combinefun = max
>>> combined_features = c.combine(features)
>>> combined_features
{'combination1': 2, 'combination2': 4}
Attributes:

setup

A Combiner_Setup object that keeps track of the feature combinations.

Type:

Combiner_Setup

Methods:

combine(features)

Combines features that are computed by an Evaluator class.