skfolio.descriptor.LogMarketCap#

class skfolio.descriptor.LogMarketCap[source]#

Log market capitalization descriptor.

Computes the natural logarithm of market capitalization:

\[\text{log\_market\_cap}(t) = \ln(\text{market\_cap}(t))\]

Log market capitalization is the standard size descriptor in equity factor models [1]. The logarithm reduces the right skew of market capitalization and produces a more stable cross-sectional scale.

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 log market capitalization.

get_metadata_routing()

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.

Notes

market_cap is the market value of common equity, computed as split-adjusted price times common shares outstanding.

Non-missing market_cap values must be finite and strictly positive.

References

[1]

“Common risk factors in the returns on stocks and bonds” Journal of Financial Economics. Fama, E. F., & French, K. R. (1993).

Examples

>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import LogMarketCap
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = LogMarketCap()
>>> log_market_cap = descriptor.fit_transform(X)
fit_transform(X, y=None, **fit_params)[source]#

Compute log market capitalization.

Parameters:
XAssetPanel

Input panel containing market_cap.

yNone

Ignored. Present for compatibility with scikit-learn’s API.

**fit_paramsdict

Additional fit parameters. Ignored.

Returns:
log_market_capndarray of shape (n_observations, n_assets)

Log market capitalization 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 MetadataRequest encapsulating 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.