cnvrg_experiment_chart package

Submodules

cnvrg_experiment_chart.chart module

Module to supliment the handling of charts in the cnvrgv2 sdk

class cnvrg_experiment_chart.chart.ExperimentChart(**kwargs)[source]

Bases: object

A class used to manage an experiment’s chart

experiment

A cnvrg Experiment object. If you do not pass in, we assume you want us to create this on your behalf.

Type:

cnvrgv2.Experiment

key

The title and reference name used for the chart

Type:

str

chart_type

The type of chart to generate

Type:

str

chart

The cnvrg Chart object generated after instantiating this object

Type:

LineChart

Examples

>>> chart = ExperimentChart(key="line_chart", chart_type="line")
>>> chart.add_series(series_name="index")
>>> chart.create_chart()
>>> chart.add_metric(series_name="index", data=[1,2,3])
add_metric(data, series_name)[source]

This method appends a data point to an existing data series (appears in UI in real time)

Parameters:
  • data (list) – This is a list of one or more data points that will be appended to the currently list of datapoints

  • series_name (str) – This is the name of the series to add the datapoints to

Returns:

self – Returns the updated ExperimentChart object allowing for method chaining

Return type:

ExperimentChart

add_series(series_name, data=None)[source]

This method adds a data series to the chart as well as the initial data point

Parameters:
  • data (list, default=None) – This is a list of one or more data points that will be added to the data series. If not included this will create an empty series.

  • series_name (str) – This is the name you would like to give the data series.

Returns:

self – Returns the updated ExperimentChart object allowing for method chaining

Return type:

ExperimentChart

create_chart()[source]

This method will add your chart to the experiment (aka. adds the chart to the experiments UI)

Returns:

self – Returns the updated ExperimentChart object allowing for method chaining

Return type:

ExperimentChart

Module contents