Skip to content

CLI

Overview

The command-line interface is exposed as the cqdisc command.

In addition to end-user commands such as learn, the CLI includes a hidden contributor command, generate-docs, for regenerating algorithm documentation pages from Jinja templates.

Generate Algorithm Pages

Run this from the repository root:

.\scripts\activate.ps1; cqdisc generate-docs

This command:

  • renders one markdown page per registered algorithm under docs/userguide/algorithms/
  • updates docs/userguide/algorithms.md when the index template is present
  • updates the Algorithms navigation block in mkdocs.yml

Optional arguments:

  • --output-dir DIR to write pages to a different directory
  • --mkdocs FILE to explicitly set the mkdocs config path

Example:

cqdisc generate-docs --output-dir docs/userguide/algorithms --mkdocs mkdocs.yml

API Docs

cli

Command-line interface for causaliq-discovery.

Functions:

  • cli

    causaliq-discovery: structure learning from data.

  • describe_cmd

    Show description, hyperparameters, and reference for ALGORITHM.

  • generate_docs_cmd

    Generate a user-guide markdown page for each registered algorithm.

  • learn_cmd

    Learn a causal graph from data.

  • list_algorithms_cmd

    List all supported structure learning algorithms.

  • main

    Entry point for the cqdisc CLI.

cli

cli() -> None

causaliq-discovery: structure learning from data.

describe_cmd

describe_cmd(algorithm: str, variant: Optional[str]) -> None

Show description, hyperparameters, and reference for ALGORITHM.

generate_docs_cmd

generate_docs_cmd(output_dir: Optional[str], mkdocs_file: Optional[str]) -> None

Generate a user-guide markdown page for each registered algorithm.

learn_cmd

learn_cmd(
    input_path: str,
    algorithm: str,
    output: str,
    hyperparameters: Optional[dict],
    trace: bool,
    variable_types: Optional[str],
    sample_size: Optional[int],
    variant: Optional[str],
    knowledge: Optional[str],
    randomise: tuple,
    seed: Optional[int],
) -> None

Learn a causal graph from data.

 Examples: cqdisc learn -i data.csv -a tabu-stable -o results/ cqdisc learn -i data.csv -a hc -o results/ -p score=bdeu -d

list_algorithms_cmd

list_algorithms_cmd() -> None

List all supported structure learning algorithms.

main

main() -> None

Entry point for the cqdisc CLI.