<a id="skfolio-measures-effective-number-assets"></a>

# skfolio.measures.effective_number_assets

<a id="skfolio.measures.effective_number_assets"></a>

### skfolio.measures.effective_number_assets(weights)

Compute the effective number of assets, defined as the inverse of the
Herfindahl index.

$$
N_{eff} = \frac{1}{\Vert w \Vert_{2}^{2}}

$$

It quantifies portfolio concentration, with a higher value indicating a more
diversified portfolio.

* **Parameters:**
  **weights** *ndarray of shape (n_assets,)*
  : Weights of the assets.
* **Returns:**
  **value** *float*
  : Effective number of assets.

### References

* <a id='r3692bcdb1be2-1'>**[1]**</a> “Banking and Financial Institutions Law in a Nutshell”. Lovett, William Anthony (1988)

