print("*** Building Data Lab")
builder = dq.DataLabBuilder(client)
builder.with_name("tutorial-data-lab")
builder.with_matching_id_format(dq.types.MatchingIdFormat.STRING)
builder.with_embeddings(50)
builder.with_demographics()
builder.with_segments()
data_lab = builder.build()
print(f"DataLab ID: {data_lab.data_lab_id}")
print("*** Provisioning datasets to Data Lab")
file_encryption_key = dq.Key()
data_lab.provision_local_datasets(
file_encryption_key,
"/path/to/matching_data.csv",
"/path/to/segments_data.csv",
demographics_data_path="/path/to/demographics_data.csv",
embeddings_data_path="/path/to/embeddings_data.csv",
)
print("*** Running Data Lab")
data_lab.run()
validation_report = data_lab.get_validation_report()
statistics_report = data_lab.get_statistics_report()
print("*** Data Lab validation report")
print(validation_report)
print("*** Data Lab statistics report")
print(statistics_report)
print("*** Building from existing Data Lab")
builder = dq.DataLabBuilder(client)
builder.from_existing(data_lab.data_lab_id)
data_lab_2 = builder.build()
print("*** Run the second Data Lab")
data_lab_2.run()
print("*** Provisioning Data Lab to LMDCR")
data_lab_2.provision_to_lookalike_media_data_room(LMDCR_HASH)