def generateRecommendation(self): result = recommendation() for i in self.itemList: try: result.itemList[i] += 1 except KeyError: result.itemList[i] = 1 return result
def __init__(self): self.population = [] self.result = recommendation() self.datasource = None self.itemsData = None self.salesData = None self.categoryData = None self.fridgeSize = 30 self.populationsize = 100 self.iteration = 50 self.mutation_chance = 0.05 self.crossover_chance = 0.2
def __init__(self): self.population = [] self.result = recommendation() self.datasource = None self.itemsData = None self.salesData = None self.categoryData = None self.fridgeSize = 15 self.populationsize = 100 self.iteration = 200 self.mutation_chance = 0.1 self.crossover_chance = 0.3 self.maximumGroupSize = 10 self.debugData = []
def generateRecommendation(self): result = recommendation() for i in self.itemList: if self.itemList[i] > self.minimumGroupSize: result.itemList[i] = self.itemList[i] return result