def runAll(path, predictMethodList, predictMethod): users = orig.loadAndUpdateFeatures(path) featureList = orig.featureList() featureList.addByRegex(["action_", "num_of_devices", "total_time"], users) category = 'country_destination' X_byteDF, y = orig.getXbyte(users, featureList.get(), category) return runClf2net(predictMethodList, predictMethod, X_byteDF, y)
# -*- coding: utf-8 -*- """ Created on Mon Mar 6 15:51:35 2017 @author: Alon """ import nnDNA as dna import geneticLib.Evolution as Evo import basicLib.loadAndTest as orig users = orig.loadAndUpdateFeatures( '../input/users_2014_actions_combined_device.csv') args = {'users': users} dnaArg = {'dna': dna, 'args': args} Ev = Evo.Evolution(dnaArg, usePrints=True, populationSize=6, numOfEvolutionSteps=10, mutationFactor=0.1) Ev.run()
def fitness(self): users = orig.loadAndUpdateFeatures('../input/users_2014_actions_combined_device.csv') self.prediction, self.fit = orig.fitPredictAndTest(users,self.featureList,self.category,self.predictMethod,random_state=1) return self.fit
# -*- coding: utf-8 -*- """ Created on Mon Mar 6 15:51:35 2017 @author: Alon """ import nnDNA as dna import geneticLib.Evolution as Evo import basicLib.loadAndTest as orig users = orig.loadAndUpdateFeatures('../input/users_2014_sessions_norm.csv') args = {'users' : users} dnaArg = {'dna' : dna, 'args' : args} Ev = Evo.Evolution(dnaArg, usePrints=True, populationSize=6, numOfEvolutionSteps=10,mutationFactor=0.1) Ev.run()
# -*- coding: utf-8 -*- """ Created on Mon Mar 6 15:51:35 2017 @author: Alon """ import nnDNA as dna import geneticLib.Evolution as Evo import basicLib.loadAndTest as orig import pandas as pd users, yRes = orig.loadAndUpdateFeatures('../input/train_users.csv') users = pd.concat([users, yRes], axis=1) args = {'users': users} dnaArg = {'dna': dna, 'args': args} Ev = Evo.Evolution(dnaArg, usePrints=True, populationSize=20, numOfEvolutionSteps=60, mutationFactor=0.1, bestMovesOn=2) Ev.run()