Skip to content

Injecting External Charts Using MissingLink CLI

This topic shows you how to inject a custom chart into a given experiment using the MissingLink CLI ml experiments updateChart command.

Preparation

  • Install and authenticate MissingLink CLI.
  • Get the id of the experiment or weights_hash of the model of the experiment you wish to inject the chart into.
  • Create an array of X axis and array of Y axis values.
    • X axis points - Array of m data points. Elements can be Strings, Ints, and Floats. For example [0,1,2], [0.1,0.2,0.3] or ["One","2","3.0"]. The type must be consistent between the elements of the array.
    • Y axis points - Array/Matrix of m data values. Can be either an array of m Integers/Floats or a matrix (having n Ints/Floats each), or a full matrix describing the values of every y chart in every data point, for example [0.0,0.1,0.2] or [[11,22],[44,55],[77,88]].

Note

Refer to MissingLink CLI for instruction on how to get the weights_hash of a model.

Write code

The following are the ml experiments updateChart flags:

  -wh, --weightsHash <sha1_hex>   The hexadecimal sha1 hash of the model's weights. 
                                  Not required if "--projectId" and "--experimentId" 
                                  are provided.
  -p, --projectId <int>           The project ID to find experiments. Use
                                  `ml projects list` to find your project
                                  IDs. Not required if "--weightsHash" is provided.
  -e, --experimentId <int>        The experiment ID. Use `ml experiments
                                  list` to find your experiment IDs.
                                  Not required if "--weightsHash" is provided.
  -c, --chartName <str>           The name of the chart. The name is used to identify 
                                  the chart against
                                  different experiments and through the same
                                  experiment. Required.
  -cxn, --chartXName <str>        Display name for charts X axis. Optional.
  -cyn, --chartYName <json_str>   Display name for chart(s) Y axis. Optional.
  -cs, --chartScope [test|validation|train]
                                  Scope type. Defaults to "test".
  -ct, --chartType [line]         Graph type. Defaults to "line".
  -cx, --chartX <json_string>     Array of m data points (X axis). Can be
                                  Strings, Integers or Floats. Required.
  -cy, --chartY <json_string>     Array/Matrix of m data values. Can be either
                                  array m of Integers/Floats or a matrix (m
                                  arrays having n Ints/Floats each), a full
                                  matrix describing the values of every chart
                                  in every data point. Required.
  --help                          Show this message and exit.

Examples

The following are examples of usage:

  • Inject a single point chart for experiment 1 in project 123:

    ml  experiments updateChart --projectId 123  --experimentId 1 \
            --chartName "my chart nmae" --chartScope train \
            --chartX '[0.1,0.5,0.8]' --chartY '[0.9,0.5,0.2]' \
            --chartXName "X" --chartYName "Y"
    
  • Inject a single point chart for experiment 1 in project 123 (with strings as X points):

    ml  experiments updateChart --projectId 123  --experimentId 1  \
            --chartName "my str chart name" --chartScope train  \
            --chartX '["0.1","0.5","0.8"]' --chartY '[[0.9],[0.5],[0.2]]' \
            --chartXName "Precision" --chartYName "Recall"
    
  • Inject a multi point chart for experiment 1 in project 123, 3 Y points per X point:

    ml  experiments updateChart --projectId 123  --experimentId 1  \
            --chartName "3 y charts one x point" --chartScope train  \
            --chartX '[4,8,12]' --chartY '[[1,2,4],[2,4,8],[3,6,12]]' \
            --chartXName "Precision" --chartYName "Recall"
    
  • Inject a multi point chart for the experiment associated with weightsHash aa918d88a21eedbf6:

    ml  experiments updateChart --weightsHash aa918d88a21eedbf6 \
            --chartName ililil --chartScope train  \
            --chartX '[4,8,12]' --chartY '[[1,2,4],[2,4,8],[3,6,12]]' \
            --chartXName "Precision" --chartYName "Recall"