# -*- 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()
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  1 13:41:01 2017

@author: Alon
"""

import featureDNA as dna
import geneticLib.Evolution as Evo

Ev = Evo.Evolution(dna,
                   usePrints=True,
                   populationSize=15,
                   numOfEvolutionSteps=10)
Ev.run()
Esempio n. 3
0
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  1 13:41:01 2017

@author: Alon
"""

import featureDNA 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=60,
                   numOfEvolutionSteps=15)
Ev.run()
"""

import featureDNA as dna
import geneticLib.Evolution as Evo
import basicLib.loadAndTest as orig
from sklearn import tree

predictMethod = tree.DecisionTreeClassifier()
users = orig.loadAndUpdateFeatures('../input/users_2014_sessions_norm.csv')
args = {'users': users, 'predictMethod': predictMethod}
dnaArg = {'dna': dna, 'args': args}
features1 = [
    'action_toggle_archived_thread_##_click_##_toggle_archived_thread'
]
features2 = [
    'affiliate_provider', 'first_affiliate_tracked', 'first_browser',
    'first_device_type', 'gender', 'language', 'signup_app', 'signup_method',
    'signup_flow'
]
genesList = [features1, features2]
hotStart = {
    'numOfGenes': len(genesList),
    'genesList': genesList
}  # genes is a list of list (list of list of feturs)
Ev = Evo.Evolution(dnaArg,
                   usePrints=True,
                   populationSize=20,
                   numOfEvolutionSteps=60,
                   hotStart=hotStart)
Ev.run()
Esempio n. 5
0
# -*- 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()