Model Scanner#

The scanner module provides a way to automatically detect issues in tabular, NLP, and LLM models. It works by running a set of automatic detectors depending on the model type. The detectors analyze the model and report any issues they find.

giskard.scanner.scan(model: BaseModel, dataset: Dataset | None = None, features: Sequence[str] | None = None, params=None, only=None, verbose=True, raise_exceptions=False)[source]#

Automatically detects model vulnerabilities.

See Scanner for more details.

  • model (BaseModel) โ€“ A Giskard model object.

  • dataset (Dataset) โ€“ A Giskard dataset object.

  • features (Sequence[str]) โ€“ A list of features to use for the scan. If not specified, all features will be used.

  • params (dict) โ€“ Advanced scanner configuration. See Scanner for more details.

  • only (list) โ€“ A tag list to limit the scan to a subset of detectors. For example, giskard.scan(model, dataset, only=["performance"]) will only run detectors for performance issues.

  • verbose (bool) โ€“ Whether to print detailed info messages. Enabled by default.

  • raise_exceptions (bool) โ€“ Whether to raise an exception if detection errors are encountered. By default, errors are logged and handled gracefully, without interrupting the scan.


A scan report object containing the results of the scan.

Return type: