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

# skfolio.descriptor.GrossProfitability

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

### *class* skfolio.descriptor.GrossProfitability

Gross profitability descriptor.

Computes the ratio of gross profit to total assets:

$$
\text{gross\_profitability}(t) =
\frac{\text{sales\_ttm}(t) - \text{cost\_of\_revenue\_ttm}(t)}
     {\text{total\_assets}(t)}
$$

Gross profitability captures a firm’s ability to generate profit from its asset base
before operating expenses, interest and taxes. It is less affected by financing,
tax and accrual accounting choices than net income-based ratios.

Profitable firms typically earn significantly higher returns than unprofitable ones [[1]](#r7a6eadba8c21-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.GrossProfitability.fit_transform)(X[, y])         | Compute gross profitability.                   |
|--------------------------------------------------------------------------------|------------------------------------------------|
| [`get_metadata_routing`](#skfolio.descriptor.GrossProfitability.get_metadata_routing)()        | Get metadata routing of this object.           |
| [`get_params`](#skfolio.descriptor.GrossProfitability.get_params)([deep])            | Get parameters for this estimator.             |
| [`partial_fit_transform`](#skfolio.descriptor.GrossProfitability.partial_fit_transform)(X[, y]) | Stateless class delegation to `fit_transform`. |
| [`set_params`](#skfolio.descriptor.GrossProfitability.set_params)(\*\*params)        | Set the parameters of this estimator.          |

#### SEE ALSO
[`GrossMargin`](https://skfolio.org/generated/skfolio.descriptor.GrossMargin.html.md#skfolio.descriptor.GrossMargin)
: Gross profit normalized by sales.

[`ReturnOnAssets`](https://skfolio.org/generated/skfolio.descriptor.ReturnOnAssets.html.md#skfolio.descriptor.ReturnOnAssets)
: Net income normalized by total assets.

### Notes

`cost_of_revenue_ttm` (trailing twelve months) should be reported as a positive
number representing the cost. The descriptor computes
`sales_ttm - cost_of_revenue_ttm` to obtain gross profit.

### References

* <a id='r7a6eadba8c21-1'>**[1]**</a> “The other side of value: The gross profitability premium” Journal of Financial Economics. Novy-Marx, R. (2013).

### Examples

```pycon
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import GrossProfitability
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = GrossProfitability()
>>> gross_profitability = descriptor.fit_transform(X)
```

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

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

Compute gross profitability.

* **Parameters:**
  **X** *AssetPanel*
  : Input panel containing `sales_ttm`, `cost_of_revenue_ttm`, and
    `total_assets`.

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

  **\*\*fit_params** *dict*
  : Additional fit parameters. Ignored.
* **Returns:**
  **gross_profitability** *ndarray of shape (n_observations, n_assets)*
  : Gross profit divided by total assets for each observation and asset.

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

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

Stateless class delegation to `fit_transform`.

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

