Version: 1.3.16

Install Certifai Toolkit

Prerequisites

  • Download the Certifai toolkit
  • Python 3.7 or 3.8 (For M1 macs use Python 3.8)
  • Conda or another virtual environment manager (Required for Windows users and recommended for all others)
  • Windows users must use PowerShell and have access to the folder where the toolkit was unzipped.

Install the Certifai Toolkit

  1. Set your context to the toolkit folder where you unzipped the contents of the Certifai Toolkit .zip during the download process.

    cd <path-to-folder-where-toolkit-was-unzipped>

    Example

    cd certifai
  2. Create a Python 3.7 or 3.8 virtual environment.

    conda create -n certifai python=<version number>

    Example

    conda create -n certifai python=3.8
  3. Activate the newly created environment.

    conda activate certifai
  4. (To enable the use of Jupyter notebooks) Install the base requirements.

    conda install --file requirements.txt
  5. Install the CERTIFAI packages.

    On MAC or Linux:

    • Install the Certifai component packages. (This may take a couple of minutes to run.)

      pip install packages/all/*
    • Install the Certifai packages specific to your python version. MAKE SURE TO USE THE SAME VERSION OF PYTHON that you specified when you created the virtual environment. (To check Python version enter python --version in your terminal or command prompt.)

      pip install packages/[your_python_version]/*

      EXAMPLE:

      If you are using python version 3.8, run:

      pip install packages/python3.8/*

    For Windows Powershell:

    • Install the CERTIFAI packages compatible with all supported Python versions.

      Get-ChildItem .\packages\all\*.zip | ForEach-Object -Process { pip install $_ }
    • Install the Certifai packages specific to your Python version. You should replace the python3.8 in the example below with the Python version you are using.

      Get-ChildItem .\packages\python3.8\*.zip | ForEach-Object -Process { pip install $_ }
  6. Verify that the Certifai CLI and client libraries are installed successfully.

    certifai -h

    A usage statement is displayed if the Certifai CLI has been installed successfully.

Special Setup instructions for optional dependencies

If you would like to perform shap-based based Explainability or Explanation analyses, you must install shap>=0.31.0. This may require a working C/C++ compiler (e.g. gcc) if pre-built binaries are not available for your system on PyPI or Conda Forge.

shap can be installed during the Toolkit installation by including the shap extras during step 5 above.

On MAC or Linux:

pip install packages/[your_python_version]/cortex-certifai-engine-<version image>.zip[shap]

Example

pip install packages/python3.8/cortex-certifai-engine-1.3.14-90-g934e7cbe-py3.8.11.zip[shap]

For Windows Powershell:

pip install .\packages\[your_python_version]\cortex-certifai-engine-[version image].zip[shap]

Example

pip install .\packages\python3.8\cortex-certifai-engine-1.3.14-90-g934e7cbe-py3.8.11.zip[shap]

The SHAP notebook available in the cortex-certifai-examples repository offers an example of shap based analyses.

Special Setup instructions for Certifai Enterprise

If you want to perform the following actions for your Certifai Enterprise installation, you must install cortex-certifai-common with additional depdencies for your platform. This gives you the ability to:

  • Push results directly to your configured cloud storage
  • Use the Certifai CLI to get scans or use cases
  • Use the Certifai CLI to get or set a baseline for a use case that is in cloud storage

Run this installation after you complete step 5 above.

  • AWS & RHOS:

    pip install packages/all/cortex-certifai-common-<version image>.zip[s3]
  • AZURE:

    pip install packages/all/cortex-certifai-common-<version image>.zip[azure]
  • GCP:

    pip install packages/all/cortex-certifai-common-<version image>.zip[gcp]

    Example

    pip install packages/all/cortex-certifai-common-1.2.14-59-g6a03e8fb.zip[s3]

Next Steps