skfolio.descriptor.SalesToPrice#

class skfolio.descriptor.SalesToPrice[source]#

Sales-to-price ratio descriptor.

Computes the ratio of trailing twelve-month sales to market capitalization:

\[\text{sales\_to\_price}(t) = \frac{\text{sales\_ttm}(t)}{\text{market\_cap}(t)}\]

Sales are less directly affected by accounting choices than earnings, providing a stable value signal. Firms with high sales relative to market capitalization are cheap on a sales basis [1]. This ratio remains available for firms with negative earnings or book equity, complementing BookToPrice.

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 sales to price.

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.

See also

BookToPrice

Common equity normalized by market capitalization.

CashFlowToPrice

Operating cash flow normalized by market capitalization.

Notes

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

This descriptor uses aggregate quantities (total sales divided by total market capitalization) rather than per-share quantities (sales per share divided by price). The two are mathematically equivalent:

\[\frac{\text{sales\_ttm}}{\text{market\_cap}} = \frac{\text{sales\_per\_share}}{\text{price}}\]

The aggregate form is preferred because it avoids subtle split-adjustment mismatches between numerator and denominator. Aggregate fundamentals are the primary form from data providers; per-share quantities are derived from them.

References

[1]

“Do sales-price and debt-equity explain stock returns better than book-market and firm size?” Financial Analysts Journal. Barbee, Mukherji & Raines (1996).

Examples

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

Compute sales to price.

Parameters:
XAssetPanel

Input panel containing sales_ttm and market_cap.

yNone

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

**fit_paramsdict

Additional fit parameters. Ignored.

Returns:
sales_to_pricendarray of shape (n_observations, n_assets)

Sales-to-price 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 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.