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

# skfolio.descriptor.BookToPrice

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

### *class* skfolio.descriptor.BookToPrice

Book-to-price ratio descriptor.

Computes the ratio of common shareholders’ equity (book equity) to market
capitalization:

$$
\text{book\_to\_price}(t) = \frac{\text{book\_equity}(t)}{\text{market\_cap}(t)}
$$

A high book-to-price ratio identifies stocks trading at a discount relative to their
common equity. Historically, cheap stocks (those with high book-to-price ratios) have
earned higher average returns than expensive stocks (those with low book-to-price
ratios) [[1]](#rc230015dfaf5-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.BookToPrice.fit_transform)(X[, y])         | Compute book to price.                         |
|--------------------------------------------------------------------------------|------------------------------------------------|
| [`get_metadata_routing`](#skfolio.descriptor.BookToPrice.get_metadata_routing)()        | Get metadata routing of this object.           |
| [`get_params`](#skfolio.descriptor.BookToPrice.get_params)([deep])            | Get parameters for this estimator.             |
| [`partial_fit_transform`](#skfolio.descriptor.BookToPrice.partial_fit_transform)(X[, y]) | Stateless class delegation to `fit_transform`. |
| [`set_params`](#skfolio.descriptor.BookToPrice.set_params)(\*\*params)        | Set the parameters of this estimator.          |

#### SEE ALSO
[`SalesToPrice`](https://skfolio.org/generated/skfolio.descriptor.SalesToPrice.html.md#skfolio.descriptor.SalesToPrice)
: Sales normalized by market capitalization.

[`CashFlowToPrice`](https://skfolio.org/generated/skfolio.descriptor.CashFlowToPrice.html.md#skfolio.descriptor.CashFlowToPrice)
: Operating cash flow normalized by market capitalization.

### Notes

Non-missing `market_cap` values must be finite and strictly positive. Negative
`book_equity` values are preserved because they carry information about the firm’s
balance sheet.

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

$$
\frac{\text{book\_equity}}{\text{price} \times \text{shares\_out}}
= \frac{\text{book\_value\_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='rc230015dfaf5-1'>**[1]**</a> “The cross-section of expected stock returns” The Journal of Finance. Fama, E. F., & French, K. R. (1992).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import BookToPrice
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = BookToPrice()
>>> book_to_price = descriptor.fit_transform(X)
```

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

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

Compute book to price.

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

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

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

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

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

Stateless class delegation to `fit_transform`.

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

