fit_sequential

pmrf.fitting.fit_sequential(model: ModelT, data: NetworkCollection, *, dynamic_kwargs: dict[str, dict[str, Any] | Callable[[Network], Any]] | None = None, callback: Callable[[FitResult], None] | None = None, **kwargs) tuple[ModelT, dict[str, FitResult]]

Sequentially fits sub-models using either optimization or sampling.

For each network in the network collection, the network’s name is used as a prefix for the features to fit, and pmrf.fitting.fit() is called.

Parameters:
  • model (Model) – The RF model to fit.

  • data (NetworkCollection) – A collection of network data whose names are used as prefixes for sub-model features.

  • dynamic_kwargs (dict[str, dict | Callable[[skrf.Network], Any]] | None, default=None) – A mapping of keyword arguments that should be resolved dynamically per network. If a value is a dict, it is resolved using the network name as the key. If a value is a callable, it is resolved by passing the network to the callable.

  • callback (Callable[[FitResult], None], default=None) – A callable called after each fit with the results of that fit.

  • **kwargs (dict) – Standard kwargs passed to pmrf.fitting.fit().

Returns:

The fully updated global Model, and a dictionary of localized results.

Return type:

tuple[Model, dict[str, OptimizeResult | InferenceResult]]