'Determine the fit of the provided individuals.
Parameters
individuals: a list of DEAP individual
One individual is a list of pipeline operators and model parameters that can be
compiled by DEAP into a callable function
features: numpy.ndarray {n_samples, n_features}
A numpy matrix containing the training and testing features for the individual\'s evaluation
target: numpy.ndarray {n_samples}
A numpy matrix containing the training and testing target for the individual\'s evaluation
sample_weight: array-like {n_samples}, optional
List of sample weights to balance (or un-balanace) the dataset target as needed
groups: array-like {n_samples, }, optional
Group labels for the samples used while splitting the dataset into train/test set
Returns
fitnesses_ordered: float
Returns a list of tuple value indicating the individual\'s fitness
according to its performance on the provided data'

def _evaluate_individuals(self, individuals, features, target, sample_weight=None, groups=None):

    if self.max_time_mins:
        total_mins_elapsed = ((datetime.now() - self._start_datetime).total_seconds() / 60.0)
        if (total_mins_elapsed >= self.max_time_mins):
            raise KeyboardInterrupt('{}    minutes    have    elapsed.    TPOT    will    close    down.'.format(total_mins_elapsed))
    (_, unique_individual_indices) = np.unique([str(ind) for ind in individuals], return_index=True)
    unique_individuals = [ind for (i, ind) in enumerate(individuals) if (i in unique_individual_indices)]
    operator_counts = {}
    eval_individuals_str = []
    sklearn_pipeline_list = []
    for individual in unique_individuals:
        individual_str = str(individual)
        sklearn_pipeline_str = generate_pipeline_code(expr_to_tree(individual, self._pset), self.operators)
        if (sklearn_pipeline_str.count('PolynomialFeatures') > 1):
            if (self.verbosity > 2):
                self._pbar.write('Invalid    pipeline    encountered.    Skipping    its    evaluation.')
            self.evaluated_individuals_[individual_str] = (5000.0, (- float('inf')))
            if (not self._pbar.disable):
                self._pbar.update(1)
        elif (individual_str in self.evaluated_individuals_):
            if (self.verbosity > 2):
                self._pbar.write('Pipeline    encountered    that    has    previously    been    evaluated    during    the    optimization    process.    Using    the    score    from    the    previous    evaluation.')
            if (not self._pbar.disable):
                self._pbar.update(1)
        else:
            try:
                sklearn_pipeline = self._toolbox.compile(expr=individual)
                self._set_param_recursive(sklearn_pipeline.steps, 'random_state', 42)
                if ('XGB' in sklearn_pipeline_str):
                    self._set_param_recursive(sklearn_pipeline.steps, 'seed', 42)
                operator_count = self._operator_count(individual)
                operator_counts[individual_str] = max(1, operator_count)
            except Exception:
                self.evaluated_individuals_[individual_str] = (5000.0, (- float('inf')))
                if (not self._pbar.disable):
                    self._pbar.update(1)
                continue
            eval_individuals_str.append(individual_str)
            sklearn_pipeline_list.append(sklearn_pipeline)
    resulting_score_list = []
    for chunk_idx in range(0, len(sklearn_pipeline_list), (self.n_jobs * 4)):
        jobs = []
        for sklearn_pipeline in sklearn_pipeline_list[chunk_idx:(chunk_idx + (self.n_jobs * 4))]:
            job = delayed(_wrapped_cross_val_score)(sklearn_pipeline=sklearn_pipeline, features=features, target=target, cv=self.cv, scoring_function=self.scoring_function, sample_weight=sample_weight, max_eval_time_mins=self.max_eval_time_mins, groups=groups)
            jobs.append(job)
        parallel = Parallel(n_jobs=self.n_jobs, verbose=0, pre_dispatch='2*n_jobs')
        tmp_result_score = parallel(jobs)
        for val in tmp_result_score:
            if (not self._pbar.disable):
                self._pbar.update(1)
            if (val == 'Timeout'):
                if (self.verbosity > 2):
                    self._pbar.write('Skipped    pipeline    #{0}    due    to    time    out.    Continuing    to    the    next    pipeline.'.format(self._pbar.n))
                resulting_score_list.append((- float('inf')))
            else:
                resulting_score_list.append(val)
    for (resulting_score, individual_str) in zip(resulting_score_list, eval_individuals_str):
        if (type(resulting_score) in [float, np.float64, np.float32]):
            self.evaluated_individuals_[individual_str] = (operator_counts[individual_str], resulting_score)
        else:
            raise ValueError('Scoring    function    does    not    return    a    float.')
    return [self.evaluated_individuals_[str(individual)] for individual in individuals]
