Skip to content

Commit

Permalink
Add Agterberg-Cheng conditional independence test CLI function
Browse files Browse the repository at this point in the history
  • Loading branch information
msorvoja committed Dec 18, 2024
1 parent 8ebc3cf commit f0240a8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions eis_toolkit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3210,6 +3210,36 @@ def weights_of_evidence_calculate_responses_cli(
)


@app.command()
def agterberg_cheng_CI_test_cli(
input_posterior_probabilities: INPUT_FILE_OPTION,
input_posterior_probabilities_std: INPUT_FILE_OPTION,
nr_of_deposits: Annotated[int, typer.Option()],
):
"""Perform the conditional independence test presented by Agterberg-Cheng (2002)."""
from eis_toolkit.prediction.weights_of_evidence import agterberg_cheng_CI_test

typer.echo("Progress: 10%")

with rasterio.open(input_posterior_probabilities) as src:
posterior_probabilities = src.read(1)

with rasterio.open(input_posterior_probabilities_std) as src:
posterior_probabilities_std = src.read(1)

typer.echo("Progress: 25%")

_, _, _, _, summary = agterberg_cheng_CI_test(
posterior_probabilities=posterior_probabilities,
posterior_probabilities_std=posterior_probabilities_std,
nr_of_deposits=nr_of_deposits,
)

typer.echo("Progress: 100%")
typer.echo("Conditional independence test completed.")
typer.echo(summary)


# --- TRANSFORMATIONS ---


Expand Down

0 comments on commit f0240a8

Please sign in to comment.