Generator Model

Encapsulates Hazy generator model file archives.

class hazy_client2.generator_model.GeneratorModel(model_file: str)

Bases: object

Encapsulates Hazy generator model file archives.

Parameters:

model_file (str) – Path to the Hazy model file

file

Path to the Hazy model file

Type:

str

tables() Optional[List[str]]

Returns a list of tables in a multitable model.

Returns:

List of table names

Return type:

list[str]

scores() Optional[dict]

Returns all model scores.

Returns:

Dictionary containing all of the model’s metrics

Return type:

dict

column_scores()

Returns all table column scores.

Returns:

Dictionary containing table column scores

Return type:

dict

score(score_type, score_name, table_name=None)

Returns a specific score.

Parameters:
  • score_type (str) – Type of score (i.e. similarity, utility, privacy)

  • score_name (str) – Name of specific score

  • table_name (str) – Name of table (for multi table models only). Defaults to None.

Returns:

Score within the range 0 - 100. A higher score indicates better performance

Return type:

float

sample_data()

Returns sample data that was generated and stored in the model file during the training stage.

Returns:

DataFrame of sample data

Return type:

DataFrame

property image

Returns the name of the Docker image used to train the model.

Returns:

Name of synthesiser’s Docker image

Return type:

str

property commit

Returns the commit sha of the Docker image used to train the model.

Returns:

Commit SHA

Return type:

str

property release_version

Returns the release version of the Docker image used to train the model in the form x.y.z.

Returns:

Release verson

Return type:

str

property generation_schema_version: Optional[SchemaVersion]

Return the generation schema version locked in by the model file once trained.

Returns:

If the schema version is None. It means the model was trained before the introduction of saving schema versions to the model file which makes it either SchemaVersion.fs(“0.0.0”) or SchemaVersion.fs(“0.1.0”). If you are using `limit_strings and batch_magnitude on and this function returns None

Return type:

Optional[SchemaVersion]

custom_metadata()

Returns the custom metadata for this model.

Returns:

Dictionary containing custom metadata

Return type:

dict