facet.data.partition.CategoryPartitioner#

class facet.data.partition.CategoryPartitioner(max_partitions=None)[source]#

Partition categorical values.

Create one partition each per unique value, considering only the max_partitions most frequent values.

Bases

Partitioner [Any]

Metaclasses

ABCMeta

Parameters

max_partitions (Optional[int]) – the maximum number of partitions to generate; must be at least 2 (default: 20)

Method summary

fit

Calculate the partitioning for the given observed values.

Attribute summary

DEFAULT_MAX_PARTITIONS

frequencies_

The count of values allocated to each partition.

is_categorical

True

is_fitted

True if this object is fitted, False otherwise.

max_partitions

The maximum number of partitions to be generated by this partitioner.

partitions_

The values representing the partitions.

Definitions

fit(values, **fit_params)[source]#

Calculate the partitioning for the given observed values.

Parameters
  • values (ndarray[Any, dtype[Any]]) – a sequence of observed values as the empirical basis for calculating the partitions

  • fit_params (Any) – optional fitting parameters

Return type

CategoryPartitioner

Returns

self

property frequencies_: numpy.ndarray[Any, numpy.dtype[numpy.int64]]#

The count of values allocated to each partition.

Return type

ndarray[Any, dtype[int64]]

property is_categorical: bool#

True

Return type

bool

property is_fitted: bool#

True if this object is fitted, False otherwise.

Return type

bool

property max_partitions: int#

The maximum number of partitions to be generated by this partitioner.

Return type

int

property partitions_: Sequence[T_Values]#

The values representing the partitions.

Return type

Sequence[TypeVar(T_Values, bound= generic)]