Example #1
0
 def _init_pyfeat(self):
     # set up pyfeat glue class object
     self._pyfeat = pyfeat.PyFeat(
         self.pop_size, self.gens, self.ml, self.classification,
         self.verbosity, self.max_stall, self.sel, self.surv,
         self.cross_rate, self.otype, self.functions, self.max_depth,
         self.max_dim, self.random_state, self.erc, self.obj, self.shuffle,
         self.split, self.fb, self.scorer, self.feature_names,
         self.backprop, self.iters, self.lr, self.batch_size,
         self.n_threads, self.hillclimb, self.logfile)
Example #2
0
 def _init_pyfeat(self):
     """set up pyfeat glue class object"""
     self._pyfeat = pyfeat.PyFeat(
         self.pop_size, self.gens, self.ml, self.classification,
         self.verbosity, self.max_stall, self.sel, self.surv,
         self.cross_rate, self.root_xo_rate, self.otype, self.functions,
         self.max_depth, self.max_dim, self.random_state, self.erc,
         self.obj, self.shuffle, self.split, self.fb, self.scorer,
         self.feature_names, self.backprop, self.iters, self.lr,
         self.batch_size, self.n_threads, self.hillclimb, self.logfile,
         self.max_time, self.use_batch, self.residual_xo, self.stagewise_xo,
         self.softmax_norm, self.print_pop, self.normalize)
Example #3
0
    def __init__(self,
                 pop_size=100,
                 gens=100,
                 ml="LinearRidgeRegression",
                 classification=False,
                 verbosity=0,
                 max_stall=0,
                 sel="lexicase",
                 surv="nsga2",
                 cross_rate=0.5,
                 otype='a',
                 functions="",
                 max_depth=3,
                 max_dim=10,
                 random_state=0,
                 erc=False,
                 obj="fitness,complexity",
                 shuffle=False,
                 split=0.75,
                 fb=0.5,
                 scorer='',
                 feature_names="",
                 backprop=False,
                 iters=10,
                 lr=0.1,
                 batch_size=100,
                 n_threads=0,
                 hillclimb=False,
                 logfile="Feat.log"):
        self.pop_size = pop_size
        self.gens = gens
        self.ml = ml.encode() if (isinstance(ml, str)) else ml

        self.classification = classification
        self.verbosity = verbosity
        self.max_stall = max_stall
        self.sel = sel.encode() if (isinstance(sel, str)) else sel
        self.surv = surv.encode() if (isinstance(surv, str)) else surv
        self.cross_rate = cross_rate
        self.otype = otype.encode() if (isinstance(otype, str)) else otype
        self.functions = functions.encode() if (isinstance(functions,
                                                           str)) else functions
        self.max_depth = max_depth
        self.max_dim = max_dim
        self.random_state = int(random_state)
        self.erc = erc
        self.obj = obj.encode() if (isinstance(obj, str)) else obj
        self.shuffle = shuffle
        self.split = split
        self.fb = fb
        self.scorer = scorer.encode() if (isinstance(scorer, str)) else scorer
        self.feature_names = feature_names.encode() if isinstance(
            feature_names, str) else feature_names
        self.backprop = bool(backprop)
        self.iters = int(iters)
        self.lr = float(lr)
        if batch_size:
            self.batch_size = int(batch_size)
        else:
            print('batch_size is None for some reason')
            self.batch_size = 100

        self.n_threads = int(n_threads)
        self.hillclimb = bool(hillclimb)
        self.logfile = logfile.encode() if isinstance(logfile,
                                                      str) else logfile

        # if self.verbosity>0:
        print('self.__dict__: ', self.__dict__)
        self._pyfeat = pyfeat.PyFeat(
            self.pop_size, self.gens, self.ml, self.classification,
            self.verbosity, self.max_stall, self.sel, self.surv,
            self.cross_rate, self.otype, self.functions, self.max_depth,
            self.max_dim, self.random_state, self.erc, self.obj, self.shuffle,
            self.split, self.fb, self.scorer, self.feature_names,
            self.backprop, self.iters, self.lr, self.batch_size,
            self.n_threads, self.hillclimb, self.logfile)