Пример #1
0
Файл: main.py Проект: hvu53/ml
    # load some data. Will change to batch work later
    dr.loadSalesData(gs._project_entry_point_ + "/../preprocess/output/Monthly_Sold_Waste/10 October_Week 3.csv","October Week 3","efficiency")
    dr.loadSalesData(gs._project_entry_point_ + "/../preprocess/output/Monthly_Sold_Waste/10 October_Week 4.csv","October Week 4","efficiency")

    # create your algorithm prototype here
    for i in range(1):
        sys.stdout.write(str(i)+' ')
        evolutionAlgorithmController = evolutionAlgorithmGroupItem()
        #evolutionAlgorithmController = evolutionAlgorithm()
    # get data from data loader
        evolutionAlgorithmController.getData(dr)
        resultForEvolutionAlgorithm = evolutionAlgorithmController.generateRecommendation()


    # calculate the objective function value
    objectiveFunctionObj = objectiveFunction()
    objectiveFunctionObj.recommendation = resultForEvolutionAlgorithm
    score = objectiveFunctionObj.assess()

    print "Final result:"

    for item in resultForEvolutionAlgorithm.itemList:
        print str(item.itemName)+"x"+str(resultForEvolutionAlgorithm.itemList[item])

    # do comparison and output the best (when we have more than 1)
    print "Test: score = "+str(score)
    print('Under Construction')
    print dr.itemData.__dict__['idToItem'][3084].__dict__['category'][4].__dict__

Пример #2
0
 def getObjectiveFunctionValue(self):
     objF = objectiveFunction()
     objF.recommendation = self.generateRecommendation()
     self.objectiveFunctionValue = objF.assess()