<a id="skfolio-descriptor-cashflowtoprice"></a>

# skfolio.descriptor.CashFlowToPrice

<a id="skfolio.descriptor.CashFlowToPrice"></a>

### *class* skfolio.descriptor.CashFlowToPrice

Cash-flow-to-price ratio descriptor.

Computes the ratio of trailing twelve-month operating cash flow to market
capitalization:

$$
\text{cash\_flow\_to\_price}(t) =
\frac{\text{operating\_cash\_flow\_ttm}(t)}{\text{market\_cap}(t)}
$$

Operating cash flow measures cash generated by a firm’s core business after
working-capital adjustments. A high ratio identifies firms generating substantial
cash relative to their market capitalization, providing a value signal that is less
directly affected by accrual accounting choices than earnings-based measures [[1]](#r4a1ae64121b5-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`](#skfolio.descriptor.CashFlowToPrice.fit_transform)(X[, y])         | Compute cash flow to price.                    |
|--------------------------------------------------------------------------------|------------------------------------------------|
| [`get_metadata_routing`](#skfolio.descriptor.CashFlowToPrice.get_metadata_routing)()        | Get metadata routing of this object.           |
| [`get_params`](#skfolio.descriptor.CashFlowToPrice.get_params)([deep])            | Get parameters for this estimator.             |
| [`partial_fit_transform`](#skfolio.descriptor.CashFlowToPrice.partial_fit_transform)(X[, y]) | Stateless class delegation to `fit_transform`. |
| [`set_params`](#skfolio.descriptor.CashFlowToPrice.set_params)(\*\*params)        | Set the parameters of this estimator.          |

#### SEE ALSO
[`CashFlowToAssets`](https://skfolio.org/generated/skfolio.descriptor.CashFlowToAssets.html.md#skfolio.descriptor.CashFlowToAssets)
: Operating cash flow normalized by total assets.

[`BookToPrice`](https://skfolio.org/generated/skfolio.descriptor.BookToPrice.html.md#skfolio.descriptor.BookToPrice)
: Common equity normalized by market capitalization.

### Notes

Non-missing `market_cap` values must be finite and strictly positive. Operating
cash flow can be negative, so this descriptor can take negative values.

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

$$
\frac{\text{operating\_cash\_flow\_ttm}}{\text{market\_cap}}
= \frac{\text{cash\_flow\_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

* <a id='r4a1ae64121b5-1'>**[1]**</a> “Contrarian investment, extrapolation, and risk” The Journal of Finance. Lakonishok, J., Shleifer, A., & Vishny, R. W. (1994).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import CashFlowToPrice
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = CashFlowToPrice()
>>> cash_flow_to_price = descriptor.fit_transform(X)
```

<a id="skfolio.descriptor.CashFlowToPrice.fit_transform"></a>

#### fit_transform(X, y=None, \*\*fit_params)

Compute cash flow to price.

* **Parameters:**
  **X** *AssetPanel*
  : Input panel containing `operating_cash_flow_ttm` and `market_cap`.

  **y** *None*
  : Ignored. Present for compatibility with scikit-learn’s API.

  **\*\*fit_params** *dict*
  : Additional fit parameters. Ignored.
* **Returns:**
  **cash_flow_to_price** *ndarray of shape (n_observations, n_assets)*
  : Cash-flow-to-price ratio for each observation and asset.

<a id="skfolio.descriptor.CashFlowToPrice.get_metadata_routing"></a>

#### get_metadata_routing()

Get metadata routing of this object.

Please check [User Guide](https://skfolio.org/user_guide/metadata_routing.html.md#metadata-routing) on how the routing
mechanism works.

* **Returns:**
  **routing** *MetadataRequest*
  : A `MetadataRequest` encapsulating
    routing information.

<a id="skfolio.descriptor.CashFlowToPrice.get_params"></a>

#### get_params(deep=True)

Get parameters for this estimator.

* **Parameters:**
  **deep** *bool, default=True*
  : If True, will return the parameters for this estimator and
    contained subobjects that are estimators.
* **Returns:**
  **params** *dict*
  : Parameter names mapped to their values.

<a id="skfolio.descriptor.CashFlowToPrice.partial_fit_transform"></a>

#### partial_fit_transform(X, y=None, \*\*fit_params)

Stateless class delegation to `fit_transform`.

<a id="skfolio.descriptor.CashFlowToPrice.set_params"></a>

#### 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:**
  **\*\*params** *dict*
  : Estimator parameters.
* **Returns:**
  **self** *estimator instance*
  : Estimator instance.

