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

# skfolio.descriptor.DebtToAssets

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

### *class* skfolio.descriptor.DebtToAssets

Debt-to-assets ratio descriptor.

Computes the ratio of total debt to total assets:

$$
\text{debt\_to\_assets}(t) =
\frac{\text{total\_debt}(t)}{\text{total\_assets}(t)}
$$

Debt-to-assets is the most widely used leverage descriptor in equity risk models.
It measures the proportion of a firm’s asset base financed by debt. Higher values
indicate greater reliance on debt financing and, all else equal, a smaller equity
cushion to absorb losses, increasing the firm’s vulnerability to earnings shocks,
adverse financing conditions and credit deterioration [[1]](#r7bd3686c5393-1).

The ratio is naturally bounded between 0 (no debt) and approximately 1 (assets fully
debt-financed), though it can exceed 1 when accumulated losses erode equity below
zero, making total liabilities exceed total assets.

NaNs are allowed as missing observations and propagate to the output. Non-missing
`total_debt` values must be finite. Non-missing `total_assets`  values must be
finite and strictly positive.

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

#### SEE ALSO
[`BookLeverage`](https://skfolio.org/generated/skfolio.descriptor.BookLeverage.html.md#skfolio.descriptor.BookLeverage)
: Leverage as a fraction of total book capital.

[`MarketLeverage`](https://skfolio.org/generated/skfolio.descriptor.MarketLeverage.html.md#skfolio.descriptor.MarketLeverage)
: Leverage as a fraction of total market capital.

### References

* <a id='r7bd3686c5393-1'>**[1]**</a> “Debt/equity ratio and expected common stock returns: empirical evidence” The Journal of Finance. Bhandari, L. C. (1988).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import DebtToAssets
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = DebtToAssets()
>>> debt_to_assets = descriptor.fit_transform(X)
```

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

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

Compute debt-to-assets ratios.

* **Parameters:**
  **X** *AssetPanel*
  : Input panel containing `total_debt` and `total_assets`.

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

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

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

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

Stateless class delegation to `fit_transform`.

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

