343a835a26b6fbf1b7bd62965b74ed2d688319a5,auto_ml/utils_ensemble.py,Ensemble,get_summary_stats,#Ensemble#Any#,80

Before Change


        for row_idx, row in predictions_df.iterrows():
            row_results = {}

            if self.type_of_estimator == "classifier":
                // TODO(PRESTON): This is erroring out when we use "ml" as our ensemble method
                // TypeError: object of type "numpy.float64" has no len()
                num_classes = len(row[0])
                for class_prediction_idx in range(num_classes):
                    class_preds = [estimator_prediction[class_prediction_idx] for estimator_prediction in row]

                    class_summarized_predictions = self.get_summary_stats_from_row(class_preds, prefix="subpredictor_class=" + str(class_prediction_idx))
                    row_results.update(class_summarized_predictions)
            else:
                row_summarized = self.get_summary_stats_from_row(row, prefix="subpredictors_")
                row_results.update(row_summarized)

            summarized_predictions.append(row_results)

        results_df = pd.DataFrame(summarized_predictions)
        return results_df

After Change


        // Each item in those subestimator lists represents the predicted probability of that class
        if isinstance(predictions_df, dict):
            flattened_dict = []
            for k, v in predictions_df.items():
                flattened_dict.append(v)

            summarized_predictions.append(self.process_one_row(flattened_dict))

        else:
            for row_idx, row in predictions_df.iterrows():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ClimbsRocks/auto_ml
Commit Name: 343a835a26b6fbf1b7bd62965b74ed2d688319a5
Time: 2016-12-08
Author: ClimbsBytes@gmail.com
File Name: auto_ml/utils_ensemble.py
Class Name: Ensemble
Method Name: get_summary_stats


Project Name: wkentaro/labelme
Commit Name: 448bd4a78699766aea66231ba442b8b5826d2a05
Time: 2019-05-15
Author: www.kentaro.wada@gmail.com
File Name: labelme/widgets/label_dialog.py
Class Name: LabelDialog
Method Name: resetFlags


Project Name: uber/ludwig
Commit Name: 690e6c8f9a42cf5b42dc010dfb073e54175da221
Time: 2020-05-07
Author: jimthompson5802@gmail.com
File Name: ludwig/models/modules/combiners.py
Class Name: ConcatCombiner
Method Name: call