Using the CLI¶
Aequitas command line interface (CLI) allows you to generate ‘The Bias Report’ with one line in the terminal. At minimum enter:
aequitas-report --input <file>
The command line interface allows the user to produce reports with more flexability than the webapp without coding in Python. Here we detail the command and provide use cases with different types of data inputs.
CLI use cases¶
Use with binary scores and csv¶
This use case is presented in getting started with aequitas-report.
aequitas-report --input <csv with binary scores>
Input data: Use when the input data has binary 0/1 scores.
score |
label_value |
race |
sex |
age |
income |
---|---|---|---|---|---|
0 |
1 |
African-American |
Female |
55 |
78000 |
1 |
1 |
Caucasian |
Female |
43 |
34000 |
Configs: With no configs, the reference group would be determined automatically based on the majority group for a given attribute and all metrics will be calculated.
Use with continuous scores or risk scores¶
aequitas-report --input <csv with continuous scores> --config configs_example.yaml
Input data:
Use when the input data has continuous scores.
score |
label_value |
race |
sex |
age |
|
---|---|---|---|---|---|
.35 |
1 |
Asian-American |
Male |
<30 |
|
.68 |
0 |
Native American |
Female |
30-50 |
or the input data has risk scores.
score |
label_value |
race |
sex |
age |
|
---|---|---|---|---|---|
3 |
1 |
Asian-American |
Male |
<30 |
|
8 |
0 |
Native American |
Female |
30-50 |
Configs: When scores are continuous, we have flexibility in who is classified in the positive or negative class based on a thresholds. (Described here or see example).
CLI flags¶
--input < path to .csv file >
¶
Absolute filepath for input dataset in csv format. If no input is provided we assume there is a db configuration in the configs.yaml file.
--config < path to config.yaml >
¶
To change default behavior uniformly across applications use a configuration file.
--output-folder <path to folder>
¶
Folder name to be created inside aequitas.
--create-tables
¶
If you are working with a database, the flag tells aequitas to create table from scratch and drop existing tables. Otherwise, it will append aequitas output. Note, database functionality must be configured in the config.yaml file.