LookoutEquipmentModel

class src.lookoutequipment.model.LookoutEquipmentModel(model_name, dataset_name)

A class to manage Lookout for Equipment models

dataset_name

The name of the dataset used to train the model attached to a given class instance

Type

string

model_name

The name of the model attached to a given class instance

Type

string

create_model_request

The parameters to be used to train the model

Type

dict

Methods

__init__(model_name, dataset_name)

Create a new instance to configure all the attributes necessary to manage a Lookout for Equipment model.

delete()

Delete the current model

poll_model_training([sleep_time])

This function polls the model describe API and prints a status until the training is done.

set_label_data(bucket, prefix, access_role_arn)

Tell Lookout for Equipment to look for labelled data to train the model and where to find them on S3

set_off_condition(off_condition)

Configure off-time detection using one of your machine’s sensors.

set_off_conditions(off_conditions_string)

Tells Lookout for Equipment to use one of the signals as a guide to tell if the asset/process is currently on or off.

set_subset_schema(field_map)

Configure the inline data schema that will let Lookout for Equipment knows that it needs to select a subset of all the signals configured at ingestion

set_target_sampling_rate(sampling_rate)

Set the sampling rate to use before training the model

set_time_periods(evaluation_start, …)

Set the training / evaluation time split

train()

Train the model as configured with this object

__init__(model_name, dataset_name)

Create a new instance to configure all the attributes necessary to manage a Lookout for Equipment model.

Parameters
  • model_name (string) – the name of the model to manage

  • dataset_name (string) – the name of the dataset associated to the model

delete()

Delete the current model

Returns

The delete model API response in JSON format

Return type

string

poll_model_training(sleep_time=60)

This function polls the model describe API and prints a status until the training is done.

Parameters

sleep_time (integer) – How many seconds should we wait before polling again (default: 60)

set_label_data(bucket, prefix, access_role_arn)

Tell Lookout for Equipment to look for labelled data to train the model and where to find them on S3

Parameters
  • bucket (string) – Bucket name where the labelled data can be found

  • prefix (string) – Prefix where the labelled data can be found

  • access_role_arn (string) – A role that Lookout for Equipment can use to access the bucket and prefix aforementioned

set_off_condition(off_condition)

Configure off-time detection using one of your machine’s sensors.

Parameters

off_condition (string) – Sensor representative of the machine’s on/off state. Ex: ‘tag_name < 1000’

set_off_conditions(off_conditions_string)

Tells Lookout for Equipment to use one of the signals as a guide to tell if the asset/process is currently on or off.

Parameters

off_conditions_string (string) – A string with the format component_nametag_name>0.0 where the condition can either be < or > with a real value materializing the boundary used to identify off time from on time.

set_subset_schema(field_map)

Configure the inline data schema that will let Lookout for Equipment knows that it needs to select a subset of all the signals configured at ingestion

Parameters

field_map – string A JSON string describing which signals to keep for this model

set_target_sampling_rate(sampling_rate)

Set the sampling rate to use before training the model

Parameters

sampling_rate (string) – One of [PT1M, PT5S, PT15M, PT1S, PT10M, PT15S, PT30M, PT10S, PT30S, PT1H, PT5M]

set_time_periods(evaluation_start, evaluation_end, training_start, training_end)

Set the training / evaluation time split

Parameters
  • evaluation_start (datetime) – Start of the evaluation period

  • evaluation_end (datetime) – End of the evaluation period

  • training_start (datetime) – Start of the training period

  • training_end (datetime) – End of the training period

train()

Train the model as configured with this object

Returns

The create model API response in JSON format

Return type

string