'Compile a DEAP pipeline into a sklearn pipeline.
Parameters
expr: DEAP individual
The DEAP pipeline to be compiled
Returns
sklearn_pipeline: sklearn.pipeline.Pipeline'

def _compile_to_sklearn(self, expr):

    sklearn_pipeline = generate_pipeline_code(expr_to_tree(expr, self._pset), self.operators)
    return eval(sklearn_pipeline, self.operators_context)
