API Reference

This section provides auto-generated documentation from the PanelSFA source code.

Base Estimator

.. py:class:: _BaseSFA(model_type: str = ‘production’, max_iter: int = 2000, tol: float = 1e-08) :module: panelsfa.base

Abstract base class for all PanelSFA estimators.

Subclasses must implement: _log_likelihood(theta, X, y, **kw) -> float returns NEGATIVE LL _unpack_theta(theta, …) -> dict natural-scale params _jlms(X, y, **kw) -> ndarray E[u|ε] per observation

.. py:property:: BaseSFA.aic :module: panelsfa.base

.. py:property:: BaseSFA.bic :module: panelsfa.base

.. py:attribute:: _BaseSFA.efficiency_scorer :module: panelsfa.base :value: make_scorer(sfa_mean_efficiency_scorer, response_method=’predict’)

.. py:attribute:: _BaseSFA.log_likelihood_scorer :module: panelsfa.base :value: make_scorer(sfa_log_likelihood_scorer, response_method=’predict’)

.. py:method:: _BaseSFA.predict(X) :module: panelsfa.base

  Return deterministic frontier prediction X @ coef_.

  :param X:
  :type X: array-like (n, k)

  :returns: **y_pred**
  :rtype: ndarray (n,)

.. py:method:: _BaseSFA.score_efficiency(X, y, **kw) :module: panelsfa.base

  Compute Technical Efficiency via the JLMS estimator.

  Returns TE = exp(−E[u|ε]) ∈ (0, 1] for every observation.
  TE = 1 denotes a fully efficient unit.

  The sign of the inefficiency term (`s`) is handled internally
  inside each subclass's `_jlms` method, so this method is
  identical for production and cost frontiers.

  :param X:
  :type X: array-like (N, k)
  :param y:
  :type y: array-like (N,)
  :param \*\*kw:
  :type \*\*kw: forwarded to subclass _jlms (groups, time, Z as needed)

  :returns: **te**
  :rtype: ndarray (N,)

.. py:method:: _BaseSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.base._BaseSFA :module: panelsfa.base

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: _BaseSFA.sfa_log_likelihood_scorer(X, y, **kwargs) :module: panelsfa.base

  Returns the maximized log-likelihood of the fitted model.
  Higher is better.

.. py:method:: _BaseSFA.sfa_mean_efficiency_scorer(X, y, **kwargs) :module: panelsfa.base

  Returns the mean technical efficiency across the sample.
  Useful if you want to find models that identify more 'reasonable'
  efficiency distributions.

Cross-Sectional Models

.. py:class:: CrossSectionalSFA(model_type: str = ‘production’, max_iter: int = 2000, tol: float = 1e-08) :module: panelsfa :canonical: panelsfa.cross_sectional.CrossSectionalSFA

Bases: :py:class:~panelsfa.base._BaseSFA

Aigner, Lovell & Schmidt (1977) Cross-Sectional SFA.

:param model_type: ‘s = +1’ for production (y − Xβ = v − u), ‘s = −1’ for cost (y − Xβ = v + u). :type model_type: {‘production’, ‘cost’}, default ‘production’ :param max_iter: Maximum iterations for L-BFGS-B. :type max_iter: int, default 2000 :param tol: Function-value tolerance for convergence. :type tol: float, default 1e-8 :param Fitted attributes: :param —————–: :param coef_: :type coef_: ndarray (k,) frontier coefficients β :param sigma_sq_: :type sigma_sq_: float total variance σ² = σ_v² + σ_u² :param gamma_: :type gamma_: float variance ratio γ = σ_u²/σ² :param log_likelihood_: :type log_likelihood_: float maximised log-likelihood

.. py:method:: CrossSectionalSFA.fit(X, y) :module: panelsfa

  Estimate ALS 1977 model via Maximum Likelihood.

  :param X: Frontier regressors. Include an intercept column explicitly.
  :type X: array-like of shape (n, k)
  :param y: Output (production) or cost variable.
  :type y: array-like of shape (n,)

  :rtype: self

.. py:method:: CrossSectionalSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.cross_sectional.CrossSectionalSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

Standard Panel Models

.. py:class:: TimeDecayPanelSFA(model_type: str = ‘production’, max_iter: int = 2000, tol: float = 1e-08) :module: panelsfa :canonical: panelsfa.time_decay.TimeDecayPanelSFA

Bases: :py:class:~panelsfa.base._BaseSFA

Battese & Coelli (1992) Time-Varying Decay Panel SFA.

:param model_type: :type model_type: {‘production’, ‘cost’}, default ‘production’ :param max_iter: :type max_iter: int, default 2000 :param tol: :type tol: float, default 1e-8 :param Fitted attributes: :param —————–: :param coef_: :type coef_: ndarray (k,) frontier coefficients β :param sigma_sq_: :type sigma_sq_: float total variance σ² :param gamma_: :type gamma_: float variance ratio σ_u²/σ² :param mu_: :type mu_: float mean of truncated-normal u_i :param eta_: :type eta_: float time-decay parameter η :param log_likelihood_: :type log_likelihood_: float maximised log-likelihood

.. py:method:: TimeDecayPanelSFA.fit(X, y, groups, time) :module: panelsfa

  Estimate BC92 model via Maximum Likelihood.

  :param X:
  :type X: array-like (N, k)  frontier regressors (with intercept)
  :param y:
  :type y: array-like (N,)    output / cost variable
  :param groups:
  :type groups: array-like (N,)    entity identifiers (any comparable type)
  :param time:
  :type time: array-like (N,)    time indices (numeric, 1-based within entity)

  :rtype: self

.. py:method:: TimeDecayPanelSFA.set_fit_request(*, groups: bool | None | str = ‘$UNCHANGED$’, time: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.time_decay.TimeDecayPanelSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``fit`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``fit`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``fit``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param groups: Metadata routing for ``groups`` parameter in ``fit``.
  :type groups: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED
  :param time: Metadata routing for ``time`` parameter in ``fit``.
  :type time: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: TimeDecayPanelSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.time_decay.TimeDecayPanelSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:class:: EffectsPanelSFA(model_type: str = ‘production’, max_iter: int = 2000, tol: float = 1e-08) :module: panelsfa :canonical: panelsfa.effects_panel.EffectsPanelSFA

Bases: :py:class:~panelsfa.base._BaseSFA

Battese & Coelli (1995) Inefficiency Effects Panel SFA.

One-step MLE: frontier parameters β and effects parameters δ are estimated simultaneously, eliminating two-step bias.

:param model_type: :type model_type: {‘production’, ‘cost’}, default ‘production’ :param max_iter: :type max_iter: int, default 2000 :param tol: :type tol: float, default 1e-8 :param Fitted attributes: :param —————–: :param coef_: :type coef_: ndarray (k,) frontier coefficients β :param delta_: :type delta_: ndarray (m,) inefficiency-effects coefficients δ :param sigma_sq_: :type sigma_sq_: float total variance σ² :param gamma_: :type gamma_: float variance ratio σ_u²/σ² :param log_likelihood_: :type log_likelihood_: float maximised log-likelihood

.. py:method:: EffectsPanelSFA.fit(X, y, groups, time=None, Z=None) :module: panelsfa

  Estimate BC95 model via Maximum Likelihood.

  :param X:
  :type X: array-like (N, k)  frontier regressors (with intercept)
  :param y:
  :type y: array-like (N,)    output / cost variable
  :param groups:
  :type groups: array-like (N,)    entity identifiers
  :param time:
  :type time: array-like (N,)    time indices (optional; not used in LL)
  :param Z: Include an intercept column in Z if desired.
  :type Z: array-like (N, m)  inefficiency-effects regressors (required)

  :rtype: self

.. py:method:: EffectsPanelSFA.set_fit_request(*, Z: bool | None | str = ‘$UNCHANGED$’, groups: bool | None | str = ‘$UNCHANGED$’, time: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.effects_panel.EffectsPanelSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``fit`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``fit`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``fit``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param Z: Metadata routing for ``Z`` parameter in ``fit``.
  :type Z: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED
  :param groups: Metadata routing for ``groups`` parameter in ``fit``.
  :type groups: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED
  :param time: Metadata routing for ``time`` parameter in ``fit``.
  :type time: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: EffectsPanelSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.effects_panel.EffectsPanelSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

Unobserved Heterogeneity (Greene 2005)

.. py:class:: TrueFixedEffectsSFA(model_type: str = ‘production’, max_iter: int = 1000, tol: float = 1e-06) :module: panelsfa :canonical: panelsfa.true_effects.TrueFixedEffectsSFA

Bases: :py:class:~panelsfa.base._BaseSFA

Greene (2005) True Fixed Effects SFA.

.. py:method:: TrueFixedEffectsSFA.set_fit_request(*, groups: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.true_effects.TrueFixedEffectsSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``fit`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``fit`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``fit``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param groups: Metadata routing for ``groups`` parameter in ``fit``.
  :type groups: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: TrueFixedEffectsSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.true_effects.TrueFixedEffectsSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:class:: TrueRandomEffectsSFA(model_type: str = ‘production’, n_simulations: int = 200, max_iter: int = 1000, tol: float = 1e-06) :module: panelsfa :canonical: panelsfa.true_effects.TrueRandomEffectsSFA

Bases: :py:class:~panelsfa.base._BaseSFA

Greene (2005) True Random Effects SFA via MSL.

.. py:method:: TrueRandomEffectsSFA.set_fit_request(*, groups: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.true_effects.TrueRandomEffectsSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``fit`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``fit`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``fit``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param groups: Metadata routing for ``groups`` parameter in ``fit``.
  :type groups: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: TrueRandomEffectsSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.true_effects.TrueRandomEffectsSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

Multi-Component Models

.. py:class:: FourComponentSFA(model_type: str = ‘production’, max_iter: int = 2000, tol: float = 1e-08) :module: panelsfa :canonical: panelsfa.four_component.FourComponentSFA

Bases: :py:class:~sklearn.base.BaseEstimator, :py:class:~sklearn.base.RegressorMixin

Kumbhakar, Lien, and Hardaker (2014) Four-Component Panel SFA.

:param model_type: :type model_type: {‘production’, ‘cost’}, default ‘production’ :param max_iter: :type max_iter: int, default 2000 :param tol: :type tol: float, default 1e-8 :param Fitted attributes: :param —————–: :param coef_: :type coef_: ndarray (k,) frontier coefficients β (excluding intercept) :param intercept_: :type intercept_: float overall frontier intercept β_0 :param sigma_v_sq_: :type sigma_v_sq_: float variance of transient noise (v_{it}) :param sigma_u_sq_: :type sigma_u_sq_: float variance of transient inefficiency (u_{it}) :param sigma_mu_sq_: :type sigma_mu_sq_: float variance of firm heterogeneity (μ_i) :param sigma_eta_sq_: :type sigma_eta_sq_: float variance of persistent inefficiency (η_i)

.. py:method:: FourComponentSFA.fit(X, y, groups) :module: panelsfa

  Estimate the Four-Component Model via the Three-Step procedure.

  :param X:
  :type X: array-like (N, k)  frontier regressors (DO NOT include an intercept column)
  :param y:
  :type y: array-like (N,)    output / cost variable
  :param groups:
  :type groups: array-like (N,)    entity identifiers

.. py:method:: FourComponentSFA.predict(X) :module: panelsfa

  Return deterministic frontier prediction: β_0 + Xβ.

.. py:method:: FourComponentSFA.score_efficiency(X, y, groups) :module: panelsfa

  Compute the Transient, Persistent, and Overall Technical Efficiency.

  :returns: **eff_dict** -- Contains three ndarrays of shape (N,):
            - 'transient'  : Transient Technical Efficiency (TTE_it)
            - 'persistent' : Persistent Technical Efficiency (PTE_i)
            - 'overall'    : Overall Technical Efficiency (OTE_it = PTE_i * TTE_it)
  :rtype: dict

.. py:method:: FourComponentSFA.set_fit_request(*, groups: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.four_component.FourComponentSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``fit`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``fit`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``fit``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param groups: Metadata routing for ``groups`` parameter in ``fit``.
  :type groups: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object

.. py:method:: FourComponentSFA.set_score_request(*, sample_weight: bool | None | str = ‘$UNCHANGED$’) -> ~panelsfa.four_component.FourComponentSFA :module: panelsfa

  Configure whether metadata should be requested to be passed to the ``score`` method.

  Note that this method is only relevant when this estimator is used as a
  sub-estimator within a :term:`meta-estimator` and metadata routing is enabled
  with ``enable_metadata_routing=True`` (see :func:`sklearn.set_config`).
  Please check the :ref:`User Guide <metadata_routing>` on how the routing
  mechanism works.

  The options for each parameter are:

  - ``True``: metadata is requested, and passed to ``score`` if provided. The request is ignored if metadata is not provided.

  - ``False``: metadata is not requested and the meta-estimator will not pass it to ``score``.

  - ``None``: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  - ``str``: metadata should be passed to the meta-estimator with this given alias instead of the original name.

  The default (``sklearn.utils.metadata_routing.UNCHANGED``) retains the
  existing request. This allows you to change the request for some
  parameters and not others.

  .. versionadded:: 1.3

  :param sample_weight: Metadata routing for ``sample_weight`` parameter in ``score``.
  :type sample_weight: str, True, False, or None,                     default=sklearn.utils.metadata_routing.UNCHANGED

  :returns: **self** -- The updated object.
  :rtype: object