462d31c615671a48dcac9d77e6de1bc360b31fee,auto_ml/predictor.py,Predictor,print_results,#Predictor#Any#Any#Any#Any#,836

Before Change


    def print_results(self, model_name, model, X, y):

        feature_responses = None
        if self.advanced_analytics == True:
            feature_responses = self.create_feature_responses(model, X, y)


        if self.ml_for_analytics and model_name in ("LogisticRegression", "RidgeClassifier", "LinearRegression", "Ridge"):
            self._print_ml_analytics_results_linear_model(model, feature_responses)

        elif self.ml_for_analytics and model_name in ["RandomForestClassifier", "RandomForestRegressor", "XGBClassifier", "XGBRegressor", "GradientBoostingRegressor", "GradientBoostingClassifier", "LGBMRegressor", "LGBMClassifier"]:

After Change


        if self.ml_for_analytics and model_name in ("LogisticRegression", "RidgeClassifier", "LinearRegression", "Ridge"):
            df_model_results = self._print_ml_analytics_results_linear_model(model)
            // TODO: only grab the top 100 features from X
            sorted_model_results = df_model_results.sort_values(by="Coefficients", ascending=False)
            sorted_model_results = sorted_model_results.reset_index(drop=True)
            top_features = set(sorted_model_results.head(n=100)["Feature Name"])

            feature_responses = self.create_feature_responses(model, X, y, top_features)
            self._join_and_print_analytics_results(feature_responses, sorted_model_results, sort_field="Coefficients")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: ClimbsRocks/auto_ml
Commit Name: 462d31c615671a48dcac9d77e6de1bc360b31fee
Time: 2017-06-25
Author: climbsbytes@gmail.com
File Name: auto_ml/predictor.py
Class Name: Predictor
Method Name: print_results


Project Name: has2k1/plotnine
Commit Name: 1e063ad3ff461a962c0aaf67e12af4a0dea32842
Time: 2016-04-23
Author: has2k1@gmail.com
File Name: ggplot/geoms/geom_step.py
Class Name: geom_step
Method Name: draw_group


Project Name: has2k1/plotnine
Commit Name: cacce80b57b57c17bc7e8ef06e991772352ed352
Time: 2015-12-22
Author: has2k1@gmail.com
File Name: ggplot/facets/layouts.py
Class Name:
Method Name: layout_grid


Project Name: instacart/lore
Commit Name: 10332a44b9a5c2d637f614df392fe9c796dfdf0a
Time: 2018-06-01
Author: montana@instacart.com
File Name: lore/encoders.py
Class Name: Unique
Method Name: fit