import pprint


def pprint_clf(clf):
    """
    Helper function for printing classifier data with comments labeling the
    feature values.
    """
    result = "{\n"
    for k, v in clf.__dict__.items():
        if k == "coef_":
            result += "    '" + k + "': array([[\n"
            for feature, feature_name in zip(v[0], clf.feature_names):
                result += "        # " + feature_name + "\n"
                result += "        " + str(feature) + ",\n"
            result += "    ]]),\n"
        elif k == "feature_names":
            continue
        else:
            result += "    '" + k + "': " + pprint.pformat(v) + ",\n"
    result += "}\n"
    return result