Experiment

Experiments are attempts to reach a specific objective based on hypothesis by using a pipeline.

Experiments are used to tests your pipelines, it is common also to train machine learning models with them.

Running a pipeline

You can run your pipeline using the wizata_dsapi to experiment manually. You should perform various manual experimentation to train models and to test your pipeline before scheduling them with a Trigger.

To run a pipeline you need its logical key (str) or technical identifier (UUID).

Here is a sample how you can run a pipeline my_pipeline on twin unit my_twin in experiment mode:

execution = wizata_dsapi.api().experiment(
    experiment='my_experiment',
    pipeline='my_pipeline',
    twin='my_twin'
)

Ideally, link your pipeline to an experiment to track result of its execution in the experimenting screen. You can create/update one with the following logic:

wizata_dsapi.api().upsert_experiment(key='my_experiment_key', name='My Experiment Display Name', 
                                     pipeline='my_pipeline_key')

To run an experiment using the UI, just click on the + Addbutton, that will display...

To update the experiment name, or change the template, pipeline or twin linked, you can click on the edit icon next to the experiment key.

Twin

Twin must be referred using its hardware ID that is registered on template used by the pipeline.

Pipeline Images

Additionally, you can also pass your pipeline image ID inside the experiment using the following logic:

wizata_dsapi.api().experiment(
    experiment='my_experiment_key',
    pipeline='my_pipeline_key',
    twin='my_twin_name',
    image='my_pipeline_image_id'
)
📘

There is an article regarding Pipeline Images

You can access to by clicking here

Properties

Properties can be referring to any parameter within your pipeline (using the @var_name notation) or simply a value you would like to use within your script.

A variable does not need to be declared on a pipeline to be used but note that you will not be able to specify it from UI if not declared.

For example, you can define the relative variables start_q and end_q to dynamically control the time range of your Query step.

Observe the @start_q/@end_q notation declared inside the query

When selecting an experiment to execute, you can define a JSON dictionary to send extra information inside the execution properties:

Alternatively, you can pass the properties dictionary programmatically when executing the experiment via Python:

execution = wizata_dsapi.api().experiment(
    experiment='my_experiment',
    pipeline='my_pipeline',
    twin='my_twin',
    properties={
        'start_q': 'now-7d',
        'end_q': 'now'
    }
)

Options

In experiment mode, by default ML model are trained and scored, plots steps are executed, but no data are modified inside the platform.

To change this behavior you can use execution_options. When using non-default executions_options those are copied into properties[‘execution_options’]

execution = wizata_dsapi.api().experiment(
    experiment='my_experiment',
    pipeline='my_pipeline',
    twin='my_twin',
    properties={
        'start_q': 'now-7d',
        'end_q': 'now'
    },
    train=False,
    plot=False,
    write=True
)
{
   "properties" : {
      "execution_options" : {
        "train" : false,
        "plot" : false,
        "write" : true
      }
   }
}

Select the correct Python version

When executing an experiment with UI you can now select the environment on which to run the experiment - if not specified it will use a default version which depends on your platform.

In Python, when using the experiment() method, your local version is sent to the platform as desired version.

But you can also set it manually if necessary:

experiment = wizata_dsapi.api().experiment(
    experiment="test_experiment",
    pipeline='centrifugal_pump_ad_training',
    version='3.12',
    twin="OG_PL1_PROC_PUMP1"
)

To check versions available in your app, please navigate to AI Lab and look at the overview.

For more information, you can take a look at the dedicated article on Upgrading your solution Python version

Deleting an experiment

To delete an experiment, you can first use the .get() method passing the experiment_key as a parameter to retrieve the experiment, and then passing it inside .delete()

experiment_object = wizata_dsapi.api().get(experiment_key="pipeline_dev5352")
wizata_dsapi.api().delete(experiment_object)

Or in the platform, by navigating to the Experiments page inside AI Lab section: