Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion faim/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.5"
__version__ = "0.0.6"
45 changes: 45 additions & 0 deletions faim/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from pathlib import Path
from typing import Tuple

import typer

app = typer.Typer(name="faim", help="FAIM CLI")
experiment_app = typer.Typer(name="experiment", help="reproduce experiments found in FAIM paper by Zehlike et al.")
app.add_typer(experiment_app)

synthetic_two_group_binormal_experiment_app = typer.Typer(
name="synthetic-two-group-binormal",
help='experiment with post-processing synthetic prediction and ground truth scores for two groups, each sampled from a corresponding binormal distribution (corresponds to "experiment with synthetic" data in paper)',
)
experiment_app.add_typer(synthetic_two_group_binormal_experiment_app)
compas_experiment_app = typer.Typer(name="compas", help="experiment with compas data")
experiment_app.add_typer(compas_experiment_app)
zalando_experiment_app = typer.Typer(name="zalando", help="experiment with Zalando data (coming soon)")
experiment_app.add_typer(zalando_experiment_app, name="zalando")

train_app = typer.Typer(name="train", help="train a FAIM post processing model")
app.add_typer(train_app)

post_process_app = typer.Typer(name="transform-scores", help="transform scores (with group-ids) given a FAIM model")
app.add_typer(post_process_app)


@synthetic_two_group_binormal_experiment_app.command(
"prepare-data", help="generate synthetic prediction and ground truth scores for two groups, each sampled from a corresponding binormal distribution"
)
def prepare_synthetic_two_group_normal_experiment_dataset(
output_dir: Path = typer.Option(Path("prepared-data/synthetic-2groups"), help="prepared data output directory"),
group1: Tuple[str, int, float, float, float] = typer.Option(
("disadvantaged", 100000, -1, -3, 0.8),
help="NAME, N_EXAMPLES, MEAN GROUND TRUTH SCORE, MEAN PREDICTION SCORE, COV(GT, PRED)",
),
group2: Tuple[str, int, float, float, float] = typer.Option(
("privileged", 100000, 1, 2, 0.8),
help="NAME, N_EXAMPLES, MEAN GROUND TRUTH SCORE, MEAN PREDICTION SCORE, COV(GT, PRED)",
),
) -> None:
...


if __name__ == "__main__":
app()
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ python_requires = >=3.8
install_requires =
pot >= 0.8.0
pandas >= 1.0.0, <2.0.0
typer>=0.7.0

[options.packages.find]
include=faim*
Expand Down