skfolio.descriptor.BookLeverage#
- class skfolio.descriptor.BookLeverage[source]#
Book leverage descriptor.
Computes the proportion of total book capital financed by debt:
\[\text{book\_leverage}(t) = \frac{\text{total\_debt}(t)} {\text{total\_debt}(t) + \text{book\_equity}(t)}\]Book leverage measures financial risk through the lens of the capital structure: the fraction of a firm’s total invested capital (debt plus common equity) that comes from creditors rather than common shareholders [1].
NaNs are allowed as missing observations and propagate to the output. Non-missing
total_debtandbook_equityvalues must be finite.This form is preferred over the debt-to-equity ratio (\(D / E\)) because the two are monotonically related (\(D / E = \text{book\_leverage} / (1 - \text{book\_leverage})\)) but book leverage is bounded in \([0, 1]\) for healthy firms, producing well-behaved cross-sectional distributions that do not require aggressive winsorization.
book_equityis common shareholders’ equity (excluding preferred stock and minority interest). When it is negative (e.g., firms with accumulated losses exceeding paid-in capital), the denominatortotal_debt + book_equitymay remain positive, become zero or turn negative:Denominator > 0 and book_equity < 0: the ratio exceeds 1. The firm is extremely leveraged, with debt exceeding total book capital. The value is a valid distress signal and is preserved in the output.
Denominator <= 0: the ratio is undefined or negative, and no longer has its intended interpretation as a measure of book leverage. These observations are masked to NaN.
This differs from
ReturnOnEquity, where any negative equity makes the concept meaningless. Here, a ratio above 1 carries real information about financial risk.- Parameters:
- None
- Attributes:
- n_assets_int
Number of assets seen during fitting.
- asset_names_ndarray of shape (n_assets,)
Asset names seen during fitting.
Methods
fit_transform(X[, y])Compute book leverage ratios.
Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
partial_fit_transform(X[, y])Stateless class delegation to
fit_transform.set_params(**params)Set the parameters of this estimator.
See also
DebtToAssetsLeverage relative to total assets.
MarketLeverageLeverage as a fraction of total market capital.
References
[1]“Capital structure decisions: which factors are reliably important?” Financial Management. Frank, M. Z., & Goyal, V. K. (2009).
Examples
>>> from skfolio.datasets import make_synthetic_characteristics >>> from skfolio.descriptor import BookLeverage >>> >>> X = make_synthetic_characteristics() >>> >>> descriptor = BookLeverage() >>> book_leverage = descriptor.fit_transform(X)
- fit_transform(X, y=None, **fit_params)[source]#
Compute book leverage ratios.
- Parameters:
- XAssetPanel
Input panel containing
total_debtandbook_equity.- yNone
Ignored. Present for compatibility with scikit-learn’s API.
- **fit_paramsdict
Additional fit parameters. Ignored.
- Returns:
- book_leveragendarray of shape (n_observations, n_assets)
Book leverage ratio for each observation and asset.
- get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routingMetadataRequest
A
MetadataRequestencapsulating routing information.
- get_params(deep=True)#
Get parameters for this estimator.
- Parameters:
- deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
- paramsdict
Parameter names mapped to their values.
- partial_fit_transform(X, y=None, **fit_params)#
Stateless class delegation to
fit_transform.
- set_params(**params)#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it’s possible to update each component of a nested object.- Parameters:
- **paramsdict
Estimator parameters.
- Returns:
- selfestimator instance
Estimator instance.