Skip to content

Rules Violation Result

verifia.verification.RulesViolationResult

Collects, analyzes, and displays rule violation results.

This class accumulates original inputs, rule violations, and constraint statistics from multiple verification runs. It generates HTML reports and JSON summaries to facilitate model verification analysis.

display()

Render and display the HTML report in a Jupyter Notebook.

This method converts the HTML representation of the report (generated by self.to_html()) to a string and uses IPython's display_html to render it. The 'raw=True' parameter ensures that the HTML is interpreted as raw HTML rather than plain text.

save_as_json(json_fpath)

Save the verification results as a JSON file.

Parameters:

Name Type Description Default
json_fpath Union[str, PathLike]

Destination file path for the JSON report.

required

log_as_json(report_name)

Log the JSON report to the model registry via MLflow or equivalent.

Parameters:

Name Type Description Default
report_name str

The report name.

required

to_html()

Render the full verification report as an HTML document.

This method assembles all required CSS and JavaScript assets (Bootstrap, jQuery), applies custom styling, and constructs the report structure.

Returns:

Name Type Description
str str

The complete HTML document serialized to a string.

log_as_html(report_name)

Log the HTML report to the model registry via MLflow or equivalent.

Parameters:

Name Type Description Default
report_name str

The report name.

required

save_as_html(html_fpath)

Save the complete verification report as an HTML file.

Parameters:

Name Type Description Default
html_fpath Union[str, PathLike]

Destination path for the HTML report.

required

clean()

Delete all persisted verification artifacts for this model.

This will remove the entire directory under the global checkpoint path corresponding to this model's full name (CHECKPOINTS_DIRPATH/). Use with caution, as this operation is irreversible.

Raises:

Type Description
FileNotFoundError

If the target directory does not exist.

PermissionError

If the directory or its contents cannot be removed due to filesystem permissions.