本文整理汇总了C#中Sample.ProbabilityOfEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Sample.ProbabilityOfEvent方法的具体用法?C# Sample.ProbabilityOfEvent怎么用?C# Sample.ProbabilityOfEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sample
的用法示例。
在下文中一共展示了Sample.ProbabilityOfEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CookieJar_Example1
public void CookieJar_Example1(int total, int choc1, int choc2, int expectedNumerator, int expectedDenominator)
{
var sample1 = new Sample<Cookie>("Jar1");
var sample2 = new Sample<Cookie>("Jar2");
var hypos = new HypoSet<Cookie>("All");
hypos.Add(sample1, sample2);
sample1.Add(total - choc1, n => new Cookie() { F = 'V' });
sample1.Add(choc1, n => new Cookie() { F = 'C' });
sample2.Add(total - choc2, n => new Cookie() { F = 'V' });
sample2.Add(choc2, n => new Cookie() { F = 'C' });
var choc = It.IsAny<Cookie>(c => c.F == 'C');
var vani = It.IsAny<Cookie>(c => c.F == 'V');
sample1.ProbabilityOfEvent(choc);
sample2.ProbabilityOfEvent(choc);
var postProb = hypos.PosterierProbability(sample1, vani);
Assert.That(postProb.Numerator, Is.EqualTo(expectedNumerator));
Assert.That(postProb.Denominator, Is.EqualTo(expectedDenominator));
}