45a5b3ee5e0fed29012d3cf2e9c785304789b034,gplearn/genetic.py,BaseSymbolic,fit,#BaseSymbolic#Any#Any#Any#,921

Before Change



        if isinstance(self, TransformerMixin):
            // Find the best individuals in the final generation
            fitness = np.array([gp.raw_fitness_ for gp in self._programs[-1]])
            hall_of_fame = fitness.argsort()[:self.hall_of_fame]
            evaluation = np.array([gp.execute(X) for gp in
                                   [self._programs[-1][i] for
                                    i in hall_of_fame]])

After Change


                                       length, X, y, sample_weight)

            // Check for early stopping
            if self.metric in ("pearson", "spearman"):
                best_fitness = fitness[np.argmax(fitness)]
                if best_fitness >= self.stopping_criteria:
                    break
            else:
                best_fitness = fitness[np.argmin(fitness)]
                if best_fitness <= self.stopping_criteria:
                    break

        if isinstance(self, RegressorMixin):
            // Find the best individual in the final generation
            self._program = self._programs[-1][np.argmin(fitness)]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: trevorstephens/gplearn
Commit Name: 45a5b3ee5e0fed29012d3cf2e9c785304789b034
Time: 2015-04-25
Author: trev.stephens@gmail.com
File Name: gplearn/genetic.py
Class Name: BaseSymbolic
Method Name: fit


Project Name: rasbt/mlxtend
Commit Name: af0d98898e2be517096c18335ab10b43b9fd461e
Time: 2015-03-17
Author: se.raschka@me.com
File Name: mlxtend/classifier/adaline.py
Class Name: Adaline
Method Name: fit


Project Name: rasbt/mlxtend
Commit Name: af0d98898e2be517096c18335ab10b43b9fd461e
Time: 2015-03-17
Author: se.raschka@me.com
File Name: mlxtend/classifier/perceptron.py
Class Name: Perceptron
Method Name: fit