コード例 #1
0
        public static Cs_TestData[] CreateSampleCbAdfData()
        {
            var sampleData = new Cs_TestData[3];

            //shared | s_1 s_2
            //0:1.0:0.5 | a_1 b_1 c_1
            //| a_2 b_2 c_2
            //| a_3 b_3 c_3

            //| b_1 c_1 d_1
            //0:0.0:0.5 | b_2 c_2 d_2

            //| a_1 b_1 c_1
            //| a_3 b_3 c_3

            sampleData[0] = new Cs_TestData
            {
                Shared = new[] { "s_1", "s_2" },
                ActionDependentFeatures = new[] {
                        new Cs_TestCs_TestDataADF
                        {
                            Features = new[] { "a_1", "b_1", "c_1" },
                            Label = new ContextualBanditLabel
                            {
                                Cost = 1f,
                                Probability = .5f
                            }
                        },
                        new Cs_TestCs_TestDataADF { Features = new [] { "a_2","b_2","c_2" } },
                        new Cs_TestCs_TestDataADF { Features = new [] { "a_3","b_3","c_3" } },
                    }
            };

            sampleData[1] = new Cs_TestData
            {
                ActionDependentFeatures = new[] {
                        new Cs_TestCs_TestDataADF { Features = new [] { "b_1","c_1","d_1" } },
                        new Cs_TestCs_TestDataADF
                        {
                            Features = new [] { "b_2", "c_2", "d_2" },
                            Label = new ContextualBanditLabel
                            {
                                Cost = 0f,
                                Probability = .5f
                            }
                        },
                    }
            };

            sampleData[2] = new Cs_TestData
            {
                ActionDependentFeatures = new[] {
                        new Cs_TestCs_TestDataADF { Features = new [] { "a_1","b_1","c_1" } },
                        new Cs_TestCs_TestDataADF { Features = new [] { "a_3","b_3","c_3" } }
                    }
            };

            return sampleData;
        }
コード例 #2
0
        public static Cs_TestData[] CreateSampleCbAdfData()
        {
            var sampleData = new Cs_TestData[3];

            //shared | s_1 s_2
            //0:1.0:0.5 | a_1 b_1 c_1
            //| a_2 b_2 c_2
            //| a_3 b_3 c_3

            //| b_1 c_1 d_1
            //0:0.0:0.5 | b_2 c_2 d_2

            //| a_1 b_1 c_1
            //| a_3 b_3 c_3

            sampleData[0] = new Cs_TestData
            {
                Shared = new[] { "s_1", "s_2" },
                ActionDependentFeatures = new[] {
                    new Cs_TestCs_TestDataADF
                    {
                        Features = new[] { "a_1", "b_1", "c_1" },
                        Label    = new ContextualBanditLabel
                        {
                            Cost        = 1f,
                            Probability = .5f
                        }
                    },
                    new Cs_TestCs_TestDataADF {
                        Features = new [] { "a_2", "b_2", "c_2" }
                    },
                    new Cs_TestCs_TestDataADF {
                        Features = new [] { "a_3", "b_3", "c_3" }
                    },
                }
            };

            sampleData[1] = new Cs_TestData
            {
                ActionDependentFeatures = new[] {
                    new Cs_TestCs_TestDataADF {
                        Features = new [] { "b_1", "c_1", "d_1" }
                    },
                    new Cs_TestCs_TestDataADF
                    {
                        Features = new [] { "b_2", "c_2", "d_2" },
                        Label    = new ContextualBanditLabel
                        {
                            Cost        = 0f,
                            Probability = .5f
                        }
                    },
                }
            };

            sampleData[2] = new Cs_TestData
            {
                ActionDependentFeatures = new[] {
                    new Cs_TestCs_TestDataADF {
                        Features = new [] { "a_1", "b_1", "c_1" }
                    },
                    new Cs_TestCs_TestDataADF {
                        Features = new [] { "a_3", "b_3", "c_3" }
                    }
                }
            };

            return(sampleData);
        }