def getHeaderObj(relationname, attribute_conf):
    """Generate header of ARFF file in JSON format

    Args:
        relationname (string): relation name, can be understood as name of dataset
        attribute_conf (dict): attribute configuration load from file

    Returns:
        dict: header JSON object of ARFF format
    """
    print("Generating header...")

    def getAttrObj(attr_info):
        attr_obj = {
            "name": attr_info['name'],
            "type": attr_info["type"],
            "class": False,
            "weight": 1.0
        }

        if attr_info['type'] == 'nominal':
            attr_obj['labels'] = attr_info['labels']
        return attr_obj

    return {
        "relation": relationname,
        "attributes": list(map(getAttrObj, attribute_conf))
    }