RandomBoolean / New Layer
Generate a new column with random boolean values (True/False) using specified probability distributions. Similar to numpy.random.choice([True, False]) or rbinom() in R. Supports both uniform (equal probability) and Bernoulli (weighted probability) distributions.
Distribution
oneofGenerate boolean values with equal probability (50% True, 50% False). Probability mass function: This is equivalent to a fair coin flip.
Generate boolean values with specified probability of True. Probability mass function: where p
is the Probability
parameter. Similar to biased coin flip with specified odds.
Probability
f64Probability (p
) of generating True
. Must be between 0
and 1
. Examples:
0.5
: Equal chance (same as Uniform)0.25
: 25% True, 75% False0.75
: 75% True, 25% False
Seed
oneofUse system-provided randomization. Each execution produces different boolean values. Suitable for security-sensitive applications, cryptographic operations, simulation, and cases where true randomness is required.
Use seeded random generation for reproducible results. Like random.seed() in Python or set.seed() in R. Essential for testing and reproducible experiments. Note: Not suitable for security-sensitive applications where predictability could be a vulnerability.
Value
u64Seed value for the random number generator. Same Value
guarantees identical sequence of random boolean values. Should not be used for security-critical operations.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.