예제 #1
0
        public void LoadTrainingData(IDBLoader loader)
        {
            this.trainingData = new Dictionary<Guid, IRecipeClassification>();
            this.breakfastIndex = new RecipeIndex();
            this.lunchIndex = new RecipeIndex();
            this.dinnerIndex = new RecipeIndex();
            this.dessertIndex = new RecipeIndex();
            var data = loader.LoadTrainingData();

            foreach (var recipe in data)
            {
                this.trainingData.Add(recipe.Recipe.Id, recipe);

                if (recipe.IsBreakfast)
                {
                    this.breakfastIndex.Add(recipe.Recipe);
                }

                if (recipe.IsLunch)
                {
                    this.lunchIndex.Add(recipe.Recipe);
                }

                if (recipe.IsDinner)
                {
                    this.dinnerIndex.Add(recipe.Recipe);
                }

                if (recipe.IsDessert)
                {
                    this.dessertIndex.Add(recipe.Recipe);
                }
            }
        }
예제 #2
0
        private void LoadTrainingData(IDBLoader loader)
        {
            this.trainingData = new Dictionary <Guid, IRecipeClassification>();

            this.breakfastIndex = new RecipeIndex();
            this.lunchIndex     = new RecipeIndex();
            this.dinnerIndex    = new RecipeIndex();
            this.dessertIndex   = new RecipeIndex();

            var data = loader.LoadTrainingData();

            foreach (var recipeClassification in data)
            {
                this.trainingData.Add(recipeClassification.Recipe.Id, recipeClassification);

                if (recipeClassification.IsBreakfast)
                {
                    this.breakfastIndex.Add(recipeClassification.Recipe);
                }
                if (recipeClassification.IsLunch)
                {
                    this.lunchIndex.Add(recipeClassification.Recipe);
                }
                if (recipeClassification.IsDinner)
                {
                    this.dinnerIndex.Add(recipeClassification.Recipe);
                }
                if (recipeClassification.IsDessert)
                {
                    this.dessertIndex.Add(recipeClassification.Recipe);
                }
            }
        }
예제 #3
0
        public void LoadTrainingData(IDBLoader loader)
        {
            trainingData = new Dictionary <Guid, IRecipeClassification>();

            BreakfastIndex = new RecipeIndex();
            LunchIndex     = new RecipeIndex();
            DinnerIndex    = new RecipeIndex();
            DessertIndex   = new RecipeIndex();

            var data = loader.LoadTrainingData();

            foreach (var recipe in data)
            {
                trainingData.Add(recipe.Recipe.Id, recipe);

                if (recipe.IsBreakfast)
                {
                    BreakfastIndex.Add(recipe.Recipe);
                }
                if (recipe.IsLunch)
                {
                    LunchIndex.Add(recipe.Recipe);
                }
                if (recipe.IsDinner)
                {
                    DinnerIndex.Add(recipe.Recipe);
                }
                if (recipe.IsDessert)
                {
                    DessertIndex.Add(recipe.Recipe);
                }
            }
        }
 public CategorizationEngine(IDBLoader loader)
 {
     this.analyzer = new Analyzer();
     this.commonIngredients = (
         from i in loader.LoadCommonIngredients()
         select i)
         .ToDictionary(k => k.IngredientId);
     this.analyzer.LoadTrainingData(loader);
 }
예제 #5
0
 public Analyzer(IDBLoader loader)
 {
     this.LoadTrainingData(loader);
 }
예제 #6
0
 public Analyzer(IDBLoader loader)
 {
     this.LoadTrainingData(loader);
 }
예제 #7
0
 public CategorizationEngine(IDBLoader loader)
 {
     this.analyzer          = new Analyzer(loader);
     this.commonIngredients = loader.LoadCommonIngredients().ToDictionary(icomonality => icomonality.IngredientId, icomonality => icomonality);
 }
예제 #8
0
 public CategorizationEngine(IDBLoader loader)
 {
     analyzer   = new Analyzer();
     commonIngs = (from i in loader.LoadCommonIngredients() select i).ToDictionary(k => k.IngredientId);
     analyzer.LoadTrainingData(loader);
 }
 public CategorizationEngine(IDBLoader loader)
 {
     this.analyzer = new Analyzer(loader);
     this.commonIngredients = loader.LoadCommonIngredients().ToDictionary(icomonality => icomonality.IngredientId, icomonality => icomonality);
 }