<a id="skfolio-utils-tools-fit-single-estimator"></a>

# skfolio.utils.tools.fit_single_estimator

<a id="skfolio.utils.tools.fit_single_estimator"></a>

### skfolio.utils.tools.fit_single_estimator(estimator, X, y, fit_params, indices=None, axis=0, method='fit')

Fit (or partial-fit) an estimator on a subset of the data.

* **Parameters:**
  **estimator** *estimator object implementing ‘fit’ and ‘predict’*
  : The object to use to fit the data.

  **X** *array-like of shape (n_observations, n_assets)*
  : The data to fit.

  **y** *array-like of shape (n_observations, n_targets), optional*
  : The target array if provided.

  **fit_params** *dict*
  : Parameters that will be passed to the estimator method.

  **indices** *ndarray, slice, optional*
  : Rows or columns to select from X, y, and fit_params.
    The default (`None`) is to select the entire data.

  **axis** *int, default=0*
  : The axis along which `X` will be sub-sampled. `axis=0` will select
    rows while `axis=1` will select columns.

  **method** *str, default=”fit”*
  : Estimator method to call (e.g. `"fit"` or `"partial_fit"`).
* **Returns:**
  **fitted_estimator** *estimator*
  : The fitted estimator.

