sassoftware / python-sasctl

Consider using literal syntax to create the data structure PTC-W0019
Performance
Minor
2 months ago4 years old
unnecessary dict call - write as literal
1302                    json_dict[1]["data"][j].update(roc_dict[j])
1303                    fitstat_data = None
1304                    if roc_dict[j]["dataMap"]["_KS_"] == 1:
1305                        fitstat_data = dict()1306                        missing_stats = (
1307                            "_KS_",
1308                            "_KS2_",
unnecessary list call - write as literal
2682        var_importances = var_importances.sort_values(
2683            by=["RelVarImportance"], ascending=False
2684        ).reset_index(drop=True)
2685        relative_importances = list()2686        for index, row in var_importances.iterrows():
2687            if row["Variable"] in interval_vars:
2688                level = "INTERVAL"
unnecessary list call - write as literal
2757                roc_table = json.load(roc_file)
2758        correct_text = ["CORRECT", "INCORRECT", "CORRECT", "INCORRECT"]
2759        outcome_values = ["1", "0", "0", "1"]
2760        misc_data = list()2761        # Iterates through ROC table to get TRAIN, TEST, and VALIDATE data with a cutoff of .5
2762        for i in range(50, 300, 100):
2763            roc_data = roc_table["data"][i]["dataMap"]
unnecessary list call - write as literal
2613
2614        # Load actionset necessary to generate variable importance
2615        conn.loadactionset("dataPreprocess")
2616        request_packages = list()2617        if target_type == "classification":
2618            method = "DTREE"
2619            treeCrit = "Entropy"
unnecessary list call - write as literal
2624            raise RuntimeError(
2625                "The selected model type is unsupported. Currently, only models that have prediction or classification target types are supported."
2626            )
2627        request_packages = list()2628        if interval_vars:
2629            request_packages.append(
2630                {