Skip to content

ExperimentBinarySuccessPolicy TCase,TOutput

NexusLabs.Foundry.Evaluation

NexusLabs.Foundry.Evaluation.Experiments

ExperimentBinarySuccessPolicy<TCase,TOutput> Class

Applies a one-sided Wilson score decision to a required boolean item metric.

public sealed class ExperimentBinarySuccessPolicy<TCase,TOutput> : NexusLabs.Foundry.Evaluation.Experiments.IExperimentRunPolicy<TCase, TOutput>

Type parameters

TCase

The caller-owned case value type.

TOutput

The caller-owned output type.

Inheritance System.Object 🡒 ExperimentBinarySuccessPolicy\<TCase,TOutput>

Implements NexusLabs.Foundry.Evaluation.Experiments.IExperimentRunPolicy<TCase,TOutput>

Constructors

ExperimentBinarySuccessPolicy(string, string, double, int, double) Constructor

Initializes a binary-success statistical policy.

public ExperimentBinarySuccessPolicy(string name, string metricName, double requiredSuccessRate, int minimumSampleCount, double confidenceLevel);

Parameters

name System.String

The stable policy name.

metricName System.String

The required boolean item metric name.

requiredSuccessRate System.Double

The required success proportion from zero through one.

minimumSampleCount System.Int32

The minimum effective denominator count.

confidenceLevel System.Double

The one-sided confidence level, greater than 0.5 and less than one.

Exceptions

System.ArgumentNullException
name or metricName is null.

System.ArgumentException
name or metricName is empty or consists only of white-space characters.

System.ArgumentOutOfRangeException
requiredSuccessRate, minimumSampleCount, or confidenceLevel is outside its supported range.

ExperimentBinarySuccessPolicy(string, string, double, int, double, bool, ExperimentUnknownSampleTreatment) Constructor

Initializes a binary-success statistical policy with an explicit required flag and unknown-sample treatment.

public ExperimentBinarySuccessPolicy(string name, string metricName, double requiredSuccessRate, int minimumSampleCount, double confidenceLevel, bool isRequired, NexusLabs.Foundry.Evaluation.Experiments.ExperimentUnknownSampleTreatment unknownSampleTreatment);

Parameters

name System.String

The stable policy name.

metricName System.String

The required boolean item metric name.

requiredSuccessRate System.Double

The required success proportion from zero through one.

minimumSampleCount System.Int32

The minimum effective denominator count.

confidenceLevel System.Double

The one-sided confidence level, greater than 0.5 and less than one.

isRequired System.Boolean

Whether this policy contributes to the run decision.

unknownSampleTreatment ExperimentUnknownSampleTreatment

The treatment for unknown item evidence.

Exceptions

System.ArgumentNullException
name or metricName is null.

System.ArgumentException
name or metricName is empty or consists only of white-space characters.

System.ArgumentOutOfRangeException
requiredSuccessRate, minimumSampleCount, confidenceLevel, or unknownSampleTreatment is outside its supported range.

Properties

ExperimentBinarySuccessPolicy<TCase,TOutput>.ConfidenceLevel Property

Gets the one-sided confidence level.

public double ConfidenceLevel { get; }

Property Value

System.Double

ExperimentBinarySuccessPolicy<TCase,TOutput>.IsRequired Property

Gets a value indicating whether this policy contributes to the run decision.

public bool IsRequired { get; }

Implements IsRequired

Property Value

System.Boolean

ExperimentBinarySuccessPolicy<TCase,TOutput>.Kind Property

Gets the evidence model used by the policy.

public NexusLabs.Foundry.Evaluation.Experiments.ExperimentPolicyKind Kind { get; }

Implements Kind

Property Value

ExperimentPolicyKind

ExperimentBinarySuccessPolicy<TCase,TOutput>.MetricName Property

Gets the required boolean item metric name.

public string MetricName { get; }

Property Value

System.String

ExperimentBinarySuccessPolicy<TCase,TOutput>.MinimumSampleCount Property

Gets the minimum effective denominator count.

public int MinimumSampleCount { get; }

Property Value

System.Int32

ExperimentBinarySuccessPolicy<TCase,TOutput>.Name Property

Gets the stable policy name.

public string Name { get; }

Implements Name

Property Value

System.String

ExperimentBinarySuccessPolicy<TCase,TOutput>.RequiredSuccessRate Property

Gets the required success proportion.

public double RequiredSuccessRate { get; }

Property Value

System.Double

ExperimentBinarySuccessPolicy<TCase,TOutput>.UnknownSampleTreatment Property

Gets the treatment for unknown item evidence.

public NexusLabs.Foundry.Evaluation.Experiments.ExperimentUnknownSampleTreatment UnknownSampleTreatment { get; }

Property Value

ExperimentUnknownSampleTreatment

Methods

ExperimentBinarySuccessPolicy<TCase,TOutput>.EvaluateAsync(ExperimentPolicyContext<TCase,TOutput>, CancellationToken) Method

Evaluates complete experiment measurements.

public System.Threading.Tasks.ValueTask<NexusLabs.Foundry.Evaluation.Experiments.ExperimentPolicyVerdict> EvaluateAsync(NexusLabs.Foundry.Evaluation.Experiments.ExperimentPolicyContext<TCase,TOutput> context, System.Threading.CancellationToken cancellationToken);

Parameters

context NexusLabs.Foundry.Evaluation.Experiments.ExperimentPolicyContext<TCase,TOutput>

The complete policy context.

cancellationToken System.Threading.CancellationToken

The caller cancellation token.

Implements EvaluateAsync(ExperimentPolicyContext<TCase,TOutput>, CancellationToken)

Returns

System.Threading.Tasks.ValueTask<ExperimentPolicyVerdict>
The structured policy evaluation.