def crossover(self, population: List[dict], scores: List[float]) -> List[dict]:
offsprings = []<EOL>ranges = self.range_scores(scores)<EOL>a = <NUM_LIT:1.> / (<NUM_LIT:1.> - self.population_size)<EOL>b = self.population_size / (self.population_size - <NUM_LIT:1.>)<EOL>probas_to_be_parent = (a * ranges + b) / np.sum(a * ranges + b)<EOL>intervals = np.array([np.sum(probas_to_be_parent[:i]) for i in range(self.population_size)])<EOL>for i in range(self.population_size - self.n_saved_best_pretrained):<EOL><INDENT>rs = np.random.random(<NUM_LIT:2>)<EOL>parents = population[np.where(rs[<NUM_LIT:0>] > intervals)[<NUM_LIT:0>][-<NUM_LIT:1>]], population[np.where(rs[<NUM_LIT:1>] > intervals)[<NUM_LIT:0>][-<NUM_LIT:1>]]<EOL>if self.decision(self.p_crossover):<EOL><INDENT>params_perm = np.random.permutation(self.n_params)<EOL>curr_offsprings = [deepcopy(parents[<NUM_LIT:0>]),<EOL>deepcopy(parents[<NUM_LIT:1>])]<EOL>part = int(self.crossover_power * self.n_params)<EOL>for j in range(self.n_params - part, self.n_params):<EOL><INDENT>self.insert_value_or_dict_into_config(curr_offsprings[<NUM_LIT:0>],<EOL>self.paths_to_params[<EOL>params_perm[j]],<EOL>self.get_value_from_config(<EOL>parents[<NUM_LIT:1>],<EOL>self.paths_to_params[<EOL>params_perm[j]]))<EOL>self.insert_value_or_dict_into_config(curr_offsprings[<NUM_LIT:1>],<EOL>self.paths_to_params[<EOL>params_perm[j]],<EOL>self.get_value_from_config(<EOL>parents[<NUM_LIT:0>],<EOL>self.paths_to_params[<EOL>params_perm[j]]))<EOL><DEDENT>offsprings.append(deepcopy(curr_offsprings[<NUM_LIT:0>]))<EOL><DEDENT>else:<EOL><INDENT>offsprings.append(deepcopy(parents[<NUM_LIT:0>]))<EOL><DEDENT><DEDENT>return offsprings<EOL>
Recombine randomly population in pairs and cross over them with given probability.
Cross over from two parents produces two offsprings
each of which contains crossover_power portion of the parameter values from one parent,
 and the other (1 - crossover_power portion) from the other parent

Args:
    population: self.population_size individuums
    scores: list of corresponding scores

Returns:
    (self.population_size - self.n_saved_best_pretained) offsprings