dreye.ReceptorEstimator.fit#

ReceptorEstimator.fit(B=None, model='gaussian', batch_size=1, verbose=0, **opt_kwargs)[source]#

Fitting source intensities given relative capture values.

Parameters:
Bndarray of shape (n_samples, n_filters)

Relative total capture points. If None, the registered B is used. Defaults to None.

modelstr or callable, optional
Model used for fitting source intensities:
  • ‘gaussian’: Gaussian model where the squared difference

    between the target and the fitted captures is minimized.

  • ‘poisson’: Poisson model that minimizes

    the negative log-likelihood of a Poisson distribution.

  • ‘excitation’: Minimizes difference between the

    target and fitted excitation values. Excitation values are define as \(e=b/(1+b)\). This function saturates at 1.

  • custom-callable: If a custom callable is given,

    this is applied to the capture values to transform them into custom excitation values. Non-linear least squares is used to minize the difference between the target and fitted excitations.

By default ‘gaussian’.

batch_sizeint, optional

Batch size used to simultaneously fit multiple samples, by default 1.

verboseint, optional

Verbosity of the fitting procedure, by default 0.

Returns:
selfobject

The ReceptorEstimator object. This is the only thing returned if B is None.

Xndarray of shape (n_samples, n_sources)

Fitted intensity values. Returned if B is not None.

Bndarray of shape (n_samples, n_filters)

Capture values calculated using the fitted intensity values. Returned if B is not None.