.. _auto_dataset_bin_columns:
*BIN NUMERIC COLUMNS INTO EQUAL-WIDTH BINS*
===========================================
Bins the values of the selected numeric columns into a fixed number of equal-width bins, mapping each value to a bin number from 1 to N. Use it to discretize continuous features for analysis or ML. Choose to add the binned values as new columns or overwrite the originals.
When to use
-----------
Classification: **process**.
Tagged: ``bin``, ``binning``, ``discretize``, ``dataset``, ``columns``, ``ml``, ``transform``.
Inputs
------
.. list-table::
:header-rows: 1
:widths: 20 20 20 20 20 20
* - Label
- ID
- Type
- Default
- Required
- Description
* - Dataset
- dataset
- dataset
- —
-
- Input dataset whose numeric columns will be binned.
* - Columns
- columns
- scalar
- —
- ✓
- Comma-separated names of the numeric columns to bin.
* - Number of bins
- num_bins
- scalar
- 5
-
- Number of equal-width bins; each value is mapped to a bin number from 1 to N.
* - Mode
- mode
- select
- new
-
- Add binned values as new
_bin columns, or overwrite the original column values.
* - Label format
- label_format
- select
- range
-
- How each binned value is labelled: a nicely-rounded range, an indexed range, or a simple bin number.
* - Round minimum
- round_min
- select
- no
-
- When Yes, the lowest bin starts at a nicely-rounded value near the data minimum (like the maximum is rounded up) instead of snapping down to a step multiple such as zero.
* - Rating direction
- rating_direction
- select
- none
-
- Tag each bin with a quality rating from best to worst. Choose which end of the value range is best. Adds a _rating column.
* - Rating columns
- rating_columns
- scalar
- —
-
- Comma-separated subset of the columns above to rate. Leave blank to rate all binned columns.
* - Rating style
- rating_style
- select
- words
-
- How each bin rating is displayed: words, letter grade, or stars.
Outputs
-------
.. list-table::
:header-rows: 1
:widths: 20 20 20 20
* - Label
- ID
- Type
- Description
* - dataset_bin_columns_output_1
- dataset_bin_columns_output_1
- dataset
- The dataset with the selected columns binned (as new _bin columns or overwritten).
Disciplines
-----------
- data.dataset.transform
Runnable example
----------------
A runnable example is registered for this worker. Open the example workflow on the d3VIEW canvas: `/api/workflow/example?id=dataset_bin_columns `_
.. raw:: html
Auto-generated from transformation schema. Worker id: dataset_bin_columns. Schema hash: a6d80fb3430d. Hand-curated docs in workerexamples/ override this page when present.