PyPi package reference¶
Robustness Toolbox https://pypi.org/project/aiverify-robustness-toolbox/
Install package, download data and model files¶
In [1]:
Copied!
!pip install aiverify-robustness-toolbox --quiet
!wget -q https://github.com/aiverify-foundation/aiverify/raw/e2a0099bf51837e516ef09ca7115cbcbd5d8896c/stock-plugins/aiverify.stock.robustness-toolbox/algorithms/robustness_toolbox/tests/user_defined_files/data/sample_bc_credit_data.sav
!wget -q https://github.com/aiverify-foundation/aiverify/raw/e2a0099bf51837e516ef09ca7115cbcbd5d8896c/stock-plugins/aiverify.stock.robustness-toolbox/algorithms/robustness_toolbox/tests/user_defined_files/model/sample_bc_credit_sklearn_linear.LogisticRegression.sav
!pip install aiverify-robustness-toolbox --quiet
!wget -q https://github.com/aiverify-foundation/aiverify/raw/e2a0099bf51837e516ef09ca7115cbcbd5d8896c/stock-plugins/aiverify.stock.robustness-toolbox/algorithms/robustness_toolbox/tests/user_defined_files/data/sample_bc_credit_data.sav
!wget -q https://github.com/aiverify-foundation/aiverify/raw/e2a0099bf51837e516ef09ca7115cbcbd5d8896c/stock-plugins/aiverify.stock.robustness-toolbox/algorithms/robustness_toolbox/tests/user_defined_files/model/sample_bc_credit_sklearn_linear.LogisticRegression.sav
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 1.2 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.3/18.3 MB 58.6 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 36.0 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 70.6 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.8/85.8 kB 7.7 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.8/60.8 kB 5.1 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.9/75.9 kB 7.8 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.5/85.5 kB 9.0 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.9/22.9 MB 56.4 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 38.2 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 38.1 MB/s eta 0:00:00 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. ipython 7.34.0 requires jedi>=0.16, which is not installed. google-genai 1.11.0 requires httpx<1.0.0,>=0.28.1, but you have httpx 0.26.0 which is incompatible. thinc 8.3.6 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.4 which is incompatible.
Execute Robustness test¶
In [2]:
Copied!
!ls
!ls
sample_bc_credit_data.sav sample_data sample_bc_credit_sklearn_linear.LogisticRegression.sav
Execute the python module by providing necessary arguments including data path, model path, ground truth path, ground truth field and model type.
In [ ]:
Copied!
!python -m aiverify_robustness_toolbox \
--data_path "sample_bc_credit_data.sav" \
--model_path "sample_bc_credit_sklearn_linear.LogisticRegression.sav" \
--ground_truth_path "sample_bc_credit_data.sav" \
--ground_truth default \
--model_type CLASSIFICATION
!python -m aiverify_robustness_toolbox \
--data_path "sample_bc_credit_data.sav" \
--model_path "sample_bc_credit_sklearn_linear.LogisticRegression.sav" \
--ground_truth_path "sample_bc_credit_data.sav" \
--ground_truth default \
--model_type CLASSIFICATION
In [ ]:
Copied!
!ls
!ls
Generated result will be stored in results.json
file
In [ ]:
Copied!
!cat /content/output/results.json
!cat /content/output/results.json
cat: /content/output/results.json: No such file or directory
Upload the result.json
file to the Portal to generate report if needed. Follow the detailed guide here for reference.