当前位置: 首页>>代码示例>>C#>>正文


C# VowpalWabbitExampleValidator.Validate方法代码示例

本文整理汇总了C#中cs_unittest.VowpalWabbitExampleValidator.Validate方法的典型用法代码示例。如果您正苦于以下问题:C# VowpalWabbitExampleValidator.Validate方法的具体用法?C# VowpalWabbitExampleValidator.Validate怎么用?C# VowpalWabbitExampleValidator.Validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cs_unittest.VowpalWabbitExampleValidator的用法示例。


在下文中一共展示了VowpalWabbitExampleValidator.Validate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestJsonDirect

        public void TestJsonDirect()
        {
            using (var vw = new VowpalWabbitExampleValidator<JsonContext>(new VowpalWabbitSettings(featureDiscovery:VowpalWabbitFeatureDiscovery.Json)))
            {
                vw.Validate("| Clicks:5 |a Bar:1 Age25_old |b Marker", new JsonContext()
                {
                    Ns1 = new Namespace1
                    {
                        Foo = 1,
                        Age = "25 old",
                        DontConsider = "XXX"
                    },
                    Ns2 = new Namespace2
                    {
                        FeatureA = true
                    },
                    Clicks = 5
                });

                vw.Validate("| Clicks:5 |a Bar:1", new JsonContext() {
                    Ns1 = new Namespace1
                    {
                        Foo = 1,
                        DontConsider = "XXX"
                    },
                    Clicks = 5,
                    IgnoreMe = "true"
                });
            }
        }
开发者ID:jconwell,项目名称:vowpal_wabbit,代码行数:30,代码来源:TestJsonDirect.cs

示例2: TestStringEscape

 public void TestStringEscape()
 {
     using (var vw = new VowpalWabbitExampleValidator<ExampleStringEscape>(string.Empty))
     {
         vw.Validate("| New_York_State", new ExampleStringEscape() { Value = "New York State" });
         vw.Validate("| new_York_state", new ExampleStringEscape() { Value = "new York state" });
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:8,代码来源:TestMarshalling.cs

示例3: TestNumericInt64OverflowArray

 public void TestNumericInt64OverflowArray()
 {
     using (var vw = new VowpalWabbitExampleValidator<NumericExampleInt64Array>(string.Empty))
     {
         vw.Validate("| 0:9.22337203685477580700E+018", new NumericExampleInt64Array() { Value = new [] { Int64.MaxValue } });
         vw.Validate("| 0:-9.22337203685477580700E+018", new NumericExampleInt64Array() { Value = new[] { Int64.MinValue } });
     }
 }
开发者ID:XkhldY,项目名称:vowpal_wabbit,代码行数:8,代码来源:TestMarshallingOverflow.cs

示例4: TestNumericDoubleOverflowArray

 public void TestNumericDoubleOverflowArray()
 {
     using (var vw = new VowpalWabbitExampleValidator<NumericExampleDoubleArray>(string.Empty))
     {
         vw.Validate("| 0:1.79769313486231570000E+308", new NumericExampleDoubleArray() { Value = new [] { double.MaxValue } });
         vw.Validate("| 0:-1.79769313486231570000E+308", new NumericExampleDoubleArray() { Value = new [] {  double.MinValue } });
     }
 }
开发者ID:XkhldY,项目名称:vowpal_wabbit,代码行数:8,代码来源:TestMarshallingOverflow.cs

示例5: TestString

 public void TestString()
 {
     using (var vw = new VowpalWabbitExampleValidator<ExampleString>(string.Empty))
     {
         vw.Validate("|abc London", new ExampleString() { Location = "London" });
         vw.Validate("", new ExampleString() { });
         vw.Validate("", new ExampleString() { Location = "" });
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:9,代码来源:TestMarshalling.cs

示例6: TestEnumerize

 public void TestEnumerize()
 {
     using(var vw = new VowpalWabbitExampleValidator<ExampleEnum>(string.Empty))
     {
         vw.Validate("| AgeEnumerize25", new ExampleEnum() { AgeEnumerize = 25 });
         vw.Validate("| AgeEnumerize0 AgeNumeric:25", new ExampleEnum() { AgeNumeric = 25 });
         vw.Validate("| AgeEnumerize0 AgeNumeric:23 AgeEnumChild", new ExampleEnum() { AgeNumeric = 23, AgeEnum = Age.Child });
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:9,代码来源:TestMarshalling.cs

示例7: TestStringFeatureGroup

 public void TestStringFeatureGroup()
 {
     using (var vw = new VowpalWabbitExampleValidator<ExampleString2>(string.Empty))
     {
         vw.Validate("|a London", new ExampleString2() { Location = "London" });
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:7,代码来源:TestMarshalling.cs

示例8: TestExpansion

 public void TestExpansion()
 {
     using (var vw = new VowpalWabbitExampleValidator<ExpansionContext>(string.Empty))
     {
         vw.Validate("| 3:.1 4:.2 5:.3", new ExpansionContext() { Features = new[] { .1f, .2f, .3f }, Offset = 3 });
     }
 }
开发者ID:lazy-developer,项目名称:vowpal_wabbit,代码行数:7,代码来源:TestExpansion.cs

示例9: TestNumericUInt64OverflowArray

 public void TestNumericUInt64OverflowArray()
 {
     using (var vw = new VowpalWabbitExampleValidator<NumericExampleUInt64Array>(string.Empty))
     {
         vw.Validate("| 0:1.844674E+19", new NumericExampleUInt64Array() { Value = new[] { UInt64.MaxValue } });
     }
 }
开发者ID:XkhldY,项目名称:vowpal_wabbit,代码行数:7,代码来源:TestMarshallingOverflow.cs

示例10: TestStringSplit

 public void TestStringSplit()
 {
     using (var vw = new VowpalWabbitExampleValidator<ExampleStringSplit>(string.Empty))
     {
         vw.Validate("| New York State", new ExampleStringSplit() { Value = "New York State" });
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:7,代码来源:TestMarshalling.cs

示例11: TestNumericUInt64Overflow

 public void TestNumericUInt64Overflow()
 {
     using (var vw = new VowpalWabbitExampleValidator<NumericExampleUInt64>(string.Empty))
     {
         vw.Validate("| Value:1.844674E+19", new NumericExampleUInt64() { Value = UInt64.MaxValue});
     }
 }
开发者ID:XkhldY,项目名称:vowpal_wabbit,代码行数:7,代码来源:TestMarshallingOverflow.cs

示例12: Validate

 private void Validate(VowpalWabbitExampleValidator<DataString> vwSharedValidation, VowpalWabbitExampleValidator<DataStringADF> vwADFValidation, DataString example)
 {
     vwSharedValidation.Validate(example.Line, example, SharedLabel.Instance);
     for (int i = 0; i < example.ActionDependentFeatures.Count; i++)
     {
         var adf = example.ActionDependentFeatures[i];
         vwADFValidation.Validate(adf.Line, adf, i == example.SelectedActionIndex ? example.Label : null);
     }
 }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:9,代码来源:TestCbAdf.cs

示例13: TestJsonDirectWithLabel

 public void TestJsonDirectWithLabel()
 {
     using (var vw = new VowpalWabbitExampleValidator<JsonContext>(new VowpalWabbitSettings(featureDiscovery: VowpalWabbitFeatureDiscovery.Json)))
     {
         vw.Validate("13 | Clicks:5 MoreClicks:3", new JsonContext()
         {
             Label = new SimpleLabel { Label = 13 },
             Clicks = 5,
             MoreClicks = 3,
             IgnoreMe2 = "YYY"
         });
     }
 }
开发者ID:jconwell,项目名称:vowpal_wabbit,代码行数:13,代码来源:TestJsonDirect.cs

示例14: TestJsonOptIn

 public void TestJsonOptIn()
 {
     using (var vw = new VowpalWabbitExampleValidator<JsonContextOptIn>(new VowpalWabbitSettings(featureDiscovery: VowpalWabbitFeatureDiscovery.Json)))
     {
         vw.Validate("| Clicked |Ns2 Marker", new JsonContextOptIn()
         {
             Clicked = true,
             IgnoredNamespace = new Namespace1 {  Foo = 3 },
             Ns2 = new Namespace2
             {
                 FeatureA = true
             }
         });
     }
 }
开发者ID:jconwell,项目名称:vowpal_wabbit,代码行数:15,代码来源:TestJsonDirect.cs

示例15: TestStringNamespace

        public void TestStringNamespace()
        {
            try
            {
                using (var vw = new VowpalWabbitExampleValidator<ExampleString3>(string.Empty))
                {
                    vw.Validate("|bc London", new ExampleString3() { Location = "London" });
                }

                Assert.Fail("Expected ArgumentException");
            }
            catch (ArgumentException)
            {
            }
        }
开发者ID:adgaudio,项目名称:vowpal_wabbit,代码行数:15,代码来源:TestMarshalling.cs


注:本文中的cs_unittest.VowpalWabbitExampleValidator.Validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。