def contains_training_instance(self, part): try: part = delete(part, self.fitness.exclude_from_regression, 0) except: pass contains, index = numpy_array_index(self.training_set, part) return contains
def get_training_instance(self, part): contains, index = numpy_array_index(self.training_set, part) if self.training_set is None: logging.error('cannot call get_training_instance if training_set is empty') return False elif contains: return self.training_fitness[index] else : logging.error('cannot call get_training_instance if training_set does not contain the particle') return False
def get_training_instance(self, part): try: part = delete(part, self.fitness.exclude_from_regression, 0) except: pass contains, index = numpy_array_index(self.training_set, part) if self.training_set is None: logging.error("cannot call get_training_instance if training_set is empty") return False elif contains: return self.training_fitness[index] else: logging.error("cannot call get_training_instance if training_set does not contain the particle") return False
def bitstream_was_generated(self, part): software_axis = [i for i, dimension in enumerate(self.fitness.designSpace) if dimension["set"] == "s"] pruned_training_set = delete(self.hard_regressor.get_training_set(),software_axis,1) pruned_part = delete([part],software_axis,1) contains, index = numpy_array_index(pruned_training_set, pruned_part[0]) return contains
def contains_training_instance(self, part): contains, index = numpy_array_index(self.training_set, part) return contains