simrunmodular_reduced_model_inferencestrategy_Strategyset_split

_Strategy.set_split

simrun.modular_reduced_model_inference.strategy._Strategy.set_split(split, setup=True)

Set the split for this strategy.

Scoring is usually performed on multiple splits of the data. This method assigns one such split to the strategy, so that all consequent calls to get_score() and get_y() will use this split.

Parameters:
  • split (array) – An array of indices to use for the split.

  • setup (bool) – Whether to setup the strategy after setting the split. Default is True.

Returns:

The strategy object with the split set.

Return type:

_Strategy

Example

>>> s = Strategy('test')
>>> s.get_score()
# returns a score for all data
>>> s = s.set_split(np.array([0, 1, 2]))
>>> s.get_score()
# returns a score for the data at indices 0, 1, and 2