Beispiel #1
0
def generate_visualization(viz_params: dict):  #pylint: disable=redefined-outer-name
    """Generates the visualization object.

    Returns:
        output_dict : output dict of vizualization obj.
    """
    viz_obj = Visualization(
        mlpipeline_ui_metadata=viz_params["mlpipeline_ui_metadata"],
        mlpipeline_metrics=viz_params["mlpipeline_metrics"],
        confusion_matrix_dict=viz_params["confusion_matrix_dict"],
        test_accuracy=viz_params["test_accuracy"],
        markdown=viz_params["markdown"],
    )

    return viz_obj.output_dict
    run_code = subprocess.run(entry_point, stdout=subprocess.PIPE)
    print(run_code.stdout)

    visualization_arguments = {
        "output": {
            "mlpipeline_ui_metadata": args["mlpipeline_ui_metadata"],
            "dataset_download_path": args["output_data"],
        },
    }

    markdown_dict = {"storage": "inline", "source": visualization_arguments}

    print("Visualization arguments: ", markdown_dict)

    visualization = Visualization(
        mlpipeline_ui_metadata=args["mlpipeline_ui_metadata"],
        markdown=markdown_dict,
    )

    y_array = np.array(y)

    label_names = [
        "airplane",
        "automobile",
        "bird",
        "cat",
        "deer",
        "dog",
        "frog",
        "horse",
        "ship",
        "truck",
Beispiel #3
0
            fp.write(json.dumps(data))

    visualization_arguments = {
        "input": {
            "tensorboard_root": TENSORBOARD_ROOT,
            "checkpoint_dir": CHECKPOINT_DIR,
            "dataset_path": DATASET_PATH,
            "model_name": script_dict["model_name"],
            "confusion_matrix_url": script_dict["confusion_matrix_url"],
        },
        "output": {
            "mlpipeline_ui_metadata": args["mlpipeline_ui_metadata"],
            "mlpipeline_metrics": args["mlpipeline_metrics"],
        },
    }

    markdown_dict = {"storage": "inline", "source": visualization_arguments}

    print("Visualization Arguments: ", markdown_dict)

    visualization = Visualization(
        test_accuracy=test_accuracy,
        confusion_matrix_dict=confusion_matrix_dict,
        mlpipeline_ui_metadata=args["mlpipeline_ui_metadata"],
        mlpipeline_metrics=args["mlpipeline_metrics"],
        markdown=markdown_dict,
    )

    checpoint_dir_contents = os.listdir(CHECKPOINT_DIR)
    print(f"Checkpoint Directory Contents: {checpoint_dir_contents}")