Skip to content

Commit

Permalink
adding quantiles to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brimoor committed Jul 12, 2022
1 parent bebb0be commit e111109
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/source/user_guide/using_aggregations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,35 @@ collection:
print(dataset.mean("predictions.detections.confidence"))
# 0.34994137249820706
.. _aggregations-quantiles:

Quantiles
_________

You can use the
:meth:`quantiles() <fiftyone.core.collections.SampleCollection.quantiles>`
aggregation to compute the quantile(s) of the (non-``None``) values of a field
in a collection:

.. code-block:: python
:linenos:
import fiftyone.zoo as foz
dataset = foz.load_zoo_dataset("quickstart")
# Compute quantiles of the `uniqueness` field
print(dataset.quantiles("uniqueness", [0.25, 0.5, 0.75, 0.9]))
# [0.22027, 0.33771, 0.62554, 0.69488]
# Compute quantiles of detection confidence in the `predictions` field
quantiles = dataset.quantiles(
"predictions.detections.confidence",
[0.25, 0.5, 0.75, 0.9],
)
print(quantiles)
# [0.09231, 0.20251, 0.56273, 0.94354]
.. _aggregations-std:

Standard deviation
Expand Down

0 comments on commit e111109

Please sign in to comment.