Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion xrspatial/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,17 @@ def natural_breaks(agg: xr.DataArray,
of values to be reclassified.
k : int, default=5
Number of classes to be produced.
num_sample : int, default=20000
num_sample : int or None, default=20000
Number of sample data points used to fit the model.
Natural Breaks (Jenks) classification is indeed O(n²) complexity,
where n is the total number of data points, i.e: `agg.size`
When n is large, we should fit the model on a small sub-sample
of the data instead of using the whole dataset.
``None`` means fit on all data instead of a sub-sample. That is
the full O(n²) case described above, so it may be slow and raises
``MemoryError`` if the Jenks matrices would exceed half of the
available RAM. For dask the full sample is drawn lazily via
indexed access.
name : str, default='natural_breaks'
Name of output aggregate.

Expand Down
Loading