public void Test9() { var sampleData = TrainSetCs_testLdf.CreateSampleCbAdfData(); // # Test 9: label-dependent features with csoaa_ldf //{VW} -k -c -d train-sets/cs_test.ldf -p cs_test.ldf.csoaa.predict --passes 10 --invariant --csoaa_ldf multiline --holdout_off // train-sets/ref/cs_test.ldf.csoaa.stderr // train-sets/ref/cs_test.ldf.csoaa.predict using (var vw = new VowpalWabbit <Cs_TestData, Cs_TestCs_TestDataADF>("-k -c -p cs_test.ldf.csoaa.predict --passes 10 --invariant --csoaa_ldf multiline --holdout_off")) { foreach (var d in sampleData) { var index = d.ActionDependentFeatures.IndexOf(a => a.Label != null); var label = d.ActionDependentFeatures[index].Label; vw.Learn(d, d.ActionDependentFeatures, index, label); } vw.Native.RunMultiPass(); VWTestHelper.AssertEqual(@"train-sets\ref\cs_test.ldf.csoaa.stderr", vw.Native.PerformanceStatistics); } Assert.AreEqual( File.ReadAllText(@"train-sets\ref\cs_test.ldf.csoaa.predict"), File.ReadAllText("cs_test.ldf.csoaa.predict")); }
public void Test9() { var sampleData = TrainSetCs_testLdf.CreateSampleCbAdfData(); // # Test 9: label-dependent features with csoaa_ldf //{VW} -k -c -d train-sets/cs_test.ldf -p cs_test.ldf.csoaa.predict --passes 10 --invariant --csoaa_ldf multiline --holdout_off // train-sets/ref/cs_test.ldf.csoaa.stderr // train-sets/ref/cs_test.ldf.csoaa.predict using (var vw = new VowpalWabbit <Cs_TestData>("-k -c -p cs_test.ldf.csoaa.predict --passes 10 --invariant --csoaa_ldf multiline --holdout_off")) { foreach (var d in sampleData) { using (var ex = vw.ReadExample(d)) { ex.Learn(); } } vw.RunMultiPass(); VWTestHelper.AssertEqual(@"train-sets\ref\cs_test.ldf.csoaa.stderr", vw.PerformanceStatistics); } Assert.AreEqual( File.ReadAllText(@"train-sets\ref\cs_test.ldf.csoaa.predict"), File.ReadAllText("cs_test.ldf.csoaa.predict")); }