From 4b908bded286cc07fcc7d908a591fb6c2ae3254e Mon Sep 17 00:00:00 2001 From: loganthomas Date: Tue, 1 Oct 2019 21:13:04 -0500 Subject: [PATCH] Fix typos in gp.cxOnePointLeafBiased() docstring and in line comment --- deap/gp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deap/gp.py b/deap/gp.py index 91082c14f..80bbbac58 100644 --- a/deap/gp.py +++ b/deap/gp.py @@ -683,7 +683,7 @@ def cxOnePointLeafBiased(ind1, ind2, termpb): :param ind1: First typed tree participating in the crossover. :param ind2: Second typed tree participating in the crossover. - :param termpb: The probability of chosing a terminal node (leaf). + :param termpb: The probability of choosing a terminal node (leaf). :returns: A tuple of two typed trees. When the nodes are strongly typed, the operator makes sure the @@ -699,7 +699,7 @@ def cxOnePointLeafBiased(ind1, ind2, termpb): # No crossover on single node tree return ind1, ind2 - # Determine wether we keep terminals or primitives for each individual + # Determine whether to keep terminals or primitives for each individual terminal_op = partial(eq, 0) primitive_op = partial(lt, 0) arity_op1 = terminal_op if random.random() < termpb else primitive_op