gigl.common.utils.kfp#
Attributes#
Classes#
| To enable component ui visualizations, your component must have an output path called | 
Module Contents#
- class gigl.common.utils.kfp.KfpOutputViewers[source]#
- To enable component ui visualizations, your component must have an output path called mlpipeline_ui_metadata and export a JSON-serialized dictionary to that path that contains metadata of what visualizations to render. - Example: component.yaml >>> outputs: >>> - {name: mlpipeline_ui_metadata, type: UI metadata} >>> … >>> command: [ >>> python, -m, some_script.py, >>> –mlpipeline_ui_metadata_path, {outputPath: mlpipeline_ui_metadata}, - some_script.py >>> if __name__ == “__main__”: >>> parser = argparse.ArgumentParser() >>> parser.add_argument( … “–mlpipeline_ui_metadata_path”, … type=str, … help=”The file path to output the visualization metadata to”, … ) >>> args = parser.parse_args() >>> outputs = KfpOutputViewers() >>> outputs.add_confusion_matrix( … confusion_matrix=array([[2, 0, 0], [0, 0, 1], [1, 0, 2]]) … ) >>> outputs.write_to_output_viewer_path(args.mlpipeline_ui_metadata_path) - https://www.kubeflow.org/docs/components/pipelines/sdk/output-viewer/ - add_confusion_matrix(confusion_matrix, vocab=None)[source]#
- Parameters:
- confusion_matrix (numpy.ndarray) 
- vocab (Optional[list[str]]) 
 
- Return type:
- None 
 
 - write_to_output_viewer_path(path)[source]#
- Parameters:
- path (gigl.common.LocalUri) 
- Return type:
- None 
 
 
