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); } } }
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); } } }
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); }
public Analyzer(IDBLoader loader) { this.LoadTrainingData(loader); }
public CategorizationEngine(IDBLoader loader) { this.analyzer = new Analyzer(loader); this.commonIngredients = loader.LoadCommonIngredients().ToDictionary(icomonality => icomonality.IngredientId, icomonality => icomonality); }
public CategorizationEngine(IDBLoader loader) { analyzer = new Analyzer(); commonIngs = (from i in loader.LoadCommonIngredients() select i).ToDictionary(k => k.IngredientId); analyzer.LoadTrainingData(loader); }