skfolio.descriptor.ReturnOnEquity#
- class skfolio.descriptor.ReturnOnEquity[source]#
Return on equity (ROE) descriptor.
Computes the ratio of trailing twelve-month net income to common shareholders’ equity:
\[\text{ROE}(t) = \frac{\text{net\_income\_ttm}(t)}{\text{book\_equity}(t)}\]Return on equity measures profitability from the common shareholders’ perspective: how much profit a firm generates per unit of common equity capital. Stocks with high \(ROE\) tend to earn higher average returns [1].
- 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 return on equity.
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
ReturnOnAssetsProfitability per unit of total assets.
Notes
When
book_equity <= 0(e.g., firms with accumulated deficits or heavy share buybacks), the ratio does not represent an interpretable return on equity. These observations are masked to NaN.References
[1]“A five-factor asset pricing model” Journal of Financial Economics. Fama, E. F., & French, K. R. (2015).
Examples
>>> from skfolio.datasets import make_synthetic_characteristics >>> from skfolio.descriptor import ReturnOnEquity >>> >>> X = make_synthetic_characteristics() >>> >>> descriptor = ReturnOnEquity() >>> return_on_equity = descriptor.fit_transform(X)
- fit_transform(X, y=None, **fit_params)[source]#
Compute return on equity.
- Parameters:
- XAssetPanel
Input panel containing
net_income_ttmandbook_equity.- yNone
Ignored. Present for compatibility with scikit-learn’s API.
- **fit_paramsdict
Additional fit parameters. Ignored.
- Returns:
- return_on_equityndarray of shape (n_observations, n_assets)
Net income divided by book equity 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.