def maximize(func, parameter_dict, args={},<EOL>verbose=False, population_size=<NUM_LIT:50>,<EOL>gene_mutation_prob=<NUM_LIT:0.1>, gene_crossover_prob=<NUM_LIT:0.5>,<EOL>tournament_size=<NUM_LIT:3>, generations_number=<NUM_LIT:10>, gene_type=None,<EOL>n_jobs=<NUM_LIT:1>, error_score='<STR_LIT>'):
toolbox = base.Toolbox()<EOL>_check_param_grid(parameter_dict)<EOL>if isinstance(n_jobs, int):<EOL><INDENT>if isinstance(n_jobs, (int, float)):<EOL><INDENT>if n_jobs > <NUM_LIT:1> or n_jobs < <NUM_LIT:0>:<EOL><INDENT>from multiprocessing import Pool  <EOL>if os.name == '<STR_LIT>':               <EOL><INDENT>warnings.warn(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"))<EOL><DEDENT>pool = Pool(n_jobs)<EOL>toolbox.register("<STR_LIT>", pool.map)<EOL>warnings.warn("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>compile()<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>toolbox.register("<STR_LIT>", n_jobs)<EOL><DEDENT>except Exception:<EOL><INDENT>raise TypeError("<STR_LIT>".format(type(n_jobs)))<EOL><DEDENT><DEDENT>name_values, gene_type, maxints = _get_param_types_maxint(parameter_dict)<EOL>if verbose:<EOL><INDENT>print("<STR_LIT>" % (gene_type, maxints))<EOL><DEDENT>toolbox.register("<STR_LIT>", _initIndividual, creator.Individual, maxints=maxints)<EOL>toolbox.register("<STR_LIT>", tools.initRepeat, list, toolbox.individual)<EOL>toolbox.register("<STR_LIT>", _evalFunction, func,<EOL>name_values=name_values, verbose=verbose,<EOL>error_score=error_score, args=args)<EOL>toolbox.register("<STR_LIT>", _cxIndividual, indpb=gene_crossover_prob, gene_type=gene_type)<EOL>toolbox.register("<STR_LIT>", _mutIndividual, indpb=gene_mutation_prob, up=maxints)<EOL>toolbox.register("<STR_LIT>", tools.selTournament, tournsize=tournament_size)<EOL>pop = toolbox.population(n=population_size)<EOL>hof = tools.HallOfFame(<NUM_LIT:1>)<EOL>stats = tools.Statistics(lambda ind: ind.fitness.values)<EOL>stats.register("<STR_LIT>", np.nanmean)<EOL>stats.register("<STR_LIT>", np.nanmin)<EOL>stats.register("<STR_LIT>", np.nanmax)<EOL>stats.register("<STR_LIT>", np.nanstd)<EOL>hist = tools.History()<EOL>toolbox.decorate("<STR_LIT>", hist.decorator)<EOL>toolbox.decorate("<STR_LIT>", hist.decorator)<EOL>hist.update(pop)<EOL>if verbose:<EOL><INDENT>print('<STR_LIT>'.format(np.prod(np.array(maxints) + <NUM_LIT:1>)))<EOL><DEDENT>pop, logbook = algorithms.eaSimple(pop, toolbox, cxpb=<NUM_LIT:0.5>, mutpb=<NUM_LIT>,<EOL>ngen=generations_number, stats=stats,<EOL>halloffame=hof, verbose=verbose)<EOL>current_best_score_ = hof[<NUM_LIT:0>].fitness.values[<NUM_LIT:0>]<EOL>current_best_params_ = _individual_to_params(hof[<NUM_LIT:0>], name_values)<EOL>_, individuals, each_scores = zip(*[(idx, indiv, np.mean(indiv.fitness.values))<EOL>for idx, indiv in list(hist.genealogy_history.items())<EOL>if indiv.fitness.valid and not np.all(np.isnan(indiv.fitness.values))])<EOL>unique_individuals = {str(indiv): (indiv, score) for indiv, score in zip(individuals, each_scores)}<EOL>score_results = tuple([(_individual_to_params(indiv, name_values), score)<EOL>for indiv, score in unique_individuals.values()])<EOL>if verbose:<EOL><INDENT>print("<STR_LIT>" % (<EOL>current_best_params_, current_best_score_))<EOL><DEDENT>if isinstance(n_jobs, int) and (n_jobs > <NUM_LIT:1> or n_jobs < <NUM_LIT:0>):<EOL><INDENT>pool.close()<EOL>pool.join()<EOL><DEDENT>return current_best_params_, current_best_score_, score_results, hist, logbook<EOL>
Same as _fit in EvolutionarySearchCV but without fitting data. More similar to scipy.optimize.

        Parameters
        ------------------
        n_jobs : int or map function, default=1
            Number of jobs to run in parallel.
            Also accepts custom parallel map functions from Pool or SCOOP.

        Returns
        ------------------
        best_params_ : dict
            A list of parameters for the best learner.

        best_score_ : float
            The score of the learner described by best_params_

        score_results : tuple of 2-tuples ((dict, float), ...)
            The score of every individual evaluation indexed by it's parameters.

        hist : deap.tools.History object.
            Use to get the geneology data of the search.

        logbook: deap.tools.Logbook object.
            Includes the statistics of the evolution.