Пример #1
0
Файл: main.py Проект: hvu53/ml
    # other packages use this to determine file locations.
    # gs._project_entry_point_ = os.getcwd()
    # print 'Entry point has been set to '+gs._project_entry_point_

    # initialize data loader
    dr = dataLoader()
    dr.initialize()

    # 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])
Пример #2
0
 def callEvolutionaryAlgorithm(self):
     evolutionAlgorithmController = evolutionAlgorithmGroupItem()
     evolutionAlgorithmController.getData(self.dr)
     resultForEvolutionAlgorithm = evolutionAlgorithmController.generateRecommendation()
     return resultForEvolutionAlgorithm