Skip to content

Conditional validation selection

ConditionalValidationSelection #

ConditionalValidationSelection(
    validation_set_id: str,
    thresholds: list[float],
    chances: list[float],
    rapid_counts: list[int],
)

Bases: RapidataSelection

Conditional validation selection class.

Probabilistically decides how many validation rapids you want to show per session based on the user score.

Parameters:

Name Type Description Default
validation_set_id str

The id of the validation set to be used.

required
thresholds list[float]

The thresholds to use for the user score.

required
chances list[float]

The chances of showing a validation rapid for each threshold.

required
rapid_counts list[int]

The amount of validation rapids that will be shown per session of this validation set for each threshold if selected by probability. (all or nothing)

required
Source code in src/rapidata/rapidata_client/selection/conditional_validation_selection.py
def __init__(
    self,
    validation_set_id: str,
    thresholds: list[float],
    chances: list[float],
    rapid_counts: list[int],
):
    if len(thresholds) != len(chances) or len(thresholds) != len(rapid_counts):
        raise ValueError(
            "The lengths of thresholds, chances and rapid_counts must be equal."
        )
    self.validation_set_id = validation_set_id
    self.thresholds = thresholds
    self.chances = chances
    self.rapid_counts = rapid_counts