Boolean

A true/false value such as whether a payment was disputed.

Boolean represents a true/false value. Use it to predict whether a payment will be disputed. mask=True keeps the answer out of the model’s inputs.

import relflow as rf

model = rf.Model.xs(
    amount=rf.Number,
    merchant=rf.Category,
    disputed=rf.Boolean(mask=True),
)

One labeled payment:

amount: 84.50
merchant: North Market
disputed: false

This is a settled training answer. A payment still awaiting its dispute outcome is not automatically a negative example. New prediction records omit disputed, leaving the amount and merchant as evidence.

Use Category for an outcome with more than two named labels.

Input and options

The Arrow leaf must be Boolean; integer and string labels are rejected. A null has its own state. Internally, false and true use fixed content values of -1 and 1, combined with a learned state embedding. Non-valued content is zero.

Option Default Meaning
threshold 0.5 One threshold or a nonempty list in [0, 1] for decision metrics. Duplicates are removed in first-seen order.

See shared leaf options for masks, decoder pooling, and embeddings.

Learning and output

Reconstruction combines state cross entropy with frequency-weighted binary cross entropy for valued targets. relflow tracks AUC and decision accuracy, precision, recall, and specificity for each configured threshold; names include accuracy@0.5 and recall@0.8. Training scores describe the latest batch; validation and test aggregate scores over the pass. See Evaluation for logging cadence.

Prediction content.probability is the probability of true. Thresholds affect metrics only; they never turn the output into a Boolean. Read it with the shared state and inferred members in the prediction envelope.

For an application-supplied trained model:

counts = rf.Boolean.counts(model, rf.Address("disputed"))

Counts include pristine valued training presentations, even when masked, and exclude the smoothing prior. Repeated epochs count again. DDP counts synchronize at epoch end, so mid-epoch snapshots may be rank-local.