Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: type-packed-bool
kind: type
description: 1-bit boolean; bit-packed with adjacent packed_bool / u4 fields.
type: reference
applies_to: inspect, predict

Bytes

ByteSize() == 0 — bit-packed. Each value is 1 bit; eight packed_bool fields share one byte. Stride math handled by Schema.RecordByteSize; place packed runs together for optimal layout. FieldType.IsBitPacked() reports true.

Range

0 or 1 — false or true. The canonical boolean encoding. Aggregators treat it as analytics-numeric (mean = positive rate, sum = positive count), with IsNumericForAnalytics() reporting true; strict IsNumeric() is false.

Null

Orthogonal. Nullable: true participates in the per-record null bitmap (independent from the value bit). 0 is false, never null. Null-skip semantics apply uniformly — mean over n non-null records.

Dictionary

Absent. packed_bool carries no inline dictionary block. The default grouper is GROUP_CATEGORY (two buckets). The default aggregator is AGG_MODE_COUNT.

Synth

profile create summarises a packed_bool through the NUMERIC accumulator (it is neither date, categorical nor set), and SpecFromProfile reconstructs it as bernoulli with p = the observed mean — ahead of --fit-shape, so a boolean never becomes a mixture. A continuous marginal is NOT a valid reconstruction: one bit forces the writer to threshold, and a clamped normal thresholded anywhere reproduces the wrong prevalence. A modelled boolean draws through a step quantile, which makes it a probit — coefficients order rows, they are not probability changes.

See