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

# skfolio.descriptor.ForwardEarningsToPrice

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

### *class* skfolio.descriptor.ForwardEarningsToPrice

Forward earnings-to-price ratio descriptor.

Computes the ratio of consensus NTM earnings per share to split-adjusted close
price:

$$
\text{forward\_earnings\_to\_price}(t) =
\frac{\text{eps\_ntm}(t)}{\text{adj\_close}(t)}
$$

Forward earnings-to-price reflects consensus expectations of future profitability
relative to the current price [[1]](#r3dbaa75bd164-1). Because it incorporates analyst forecasts rather
than trailing accounting data, it captures forward-looking value and is less
affected by stale or one-off items in historical earnings. A high ratio identifies
firms expected to generate strong earnings relative to their price.

Unlike the other value descriptors which use aggregate fundamentals divided by
`market_cap`, this descriptor uses per-share quantities (`eps_ntm / adj_close`).
Consensus estimates from data providers are delivered as per-share forecasts,
making per-share the primary form. `eps_ntm` should use the same split-adjustment
basis as `adj_close`.

The aggregate equivalent is:

$$
\frac{\text{eps\_ntm}}{\text{adj\_close}}
= \frac{\text{eps\_ntm} \times \text{shares\_out}}
      {\text{adj\_close} \times \text{shares\_out}}
= \frac{\text{earnings\_ntm}}{\text{market\_cap}}
$$

* **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.ForwardEarningsToPrice.fit_transform)(X[, y])         | Compute forward earnings-to-price ratios.      |
|--------------------------------------------------------------------------------|------------------------------------------------|
| [`get_metadata_routing`](#skfolio.descriptor.ForwardEarningsToPrice.get_metadata_routing)()        | Get metadata routing of this object.           |
| [`get_params`](#skfolio.descriptor.ForwardEarningsToPrice.get_params)([deep])            | Get parameters for this estimator.             |
| [`partial_fit_transform`](#skfolio.descriptor.ForwardEarningsToPrice.partial_fit_transform)(X[, y]) | Stateless class delegation to `fit_transform`. |
| [`set_params`](#skfolio.descriptor.ForwardEarningsToPrice.set_params)(\*\*params)        | Set the parameters of this estimator.          |

### References

* <a id='r3dbaa75bd164-1'>**[1]**</a> “Expectations and share prices” Management Science. Elton, E. J., Gruber, M. J., & Gultekin, M. (1981).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import ForwardEarningsToPrice
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = ForwardEarningsToPrice()
>>> forward_earnings_to_price = descriptor.fit_transform(X)
```

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

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

Compute forward earnings-to-price ratios.

* **Parameters:**
  **X** *AssetPanel*
  : Input panel containing `eps_ntm` and `adj_close`.

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

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

<a id="skfolio.descriptor.ForwardEarningsToPrice.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.ForwardEarningsToPrice.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.ForwardEarningsToPrice.partial_fit_transform"></a>

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

Stateless class delegation to `fit_transform`.

<a id="skfolio.descriptor.ForwardEarningsToPrice.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.

