geostep.analyzer.CRTAnalyzer

class geostep.analyzer.CRTAnalyzer(config: AnalyzerConfig | None = None, bootstrap_reps: int = 1000, bootstrap_seed: int | None = None, performance_config: ParallelConfig | None = None)[source]

Analyzer for Cluster Randomized Trials (CRT), including staircase designs.

Methods

__init__([config, bootstrap_reps, ...])

Initialize CRT analyzer.

analyze(df, **kwargs)

Template method implementing the analysis workflow.

enable_monitoring([enabled])

Enable or disable performance monitoring.

get_metrics()

Get performance and execution metrics.

monitor_operation(operation_name[, ...])

Context manager for monitoring operations.

post_process_result(result)

Post-process analysis results.

prepare_data(**kwargs)

Prepare data for CRT analysis with performance optimizations.

set_metrics_collector(collector)

Set the metrics collector for this instance.

validate_inputs(df, **kwargs)

Validate inputs for CRT analysis.

Attributes

__init__(config: AnalyzerConfig | None = None, bootstrap_reps: int = 1000, bootstrap_seed: int | None = None, performance_config: ParallelConfig | None = None)[source]

Initialize CRT analyzer.

Parameters:
  • config (AnalyzerConfig, optional) – Configuration for analyzer behavior.

  • bootstrap_reps (int, optional) – Number of bootstrap replications (default: 1000).

  • bootstrap_seed (int, optional) – Random seed for bootstrap sampling.

  • performance_config (ParallelConfig, optional) – Configuration for performance optimizations.

validate_inputs(df: DataFrame, **kwargs: Any) None[source]

Validate inputs for CRT analysis.

prepare_data(**kwargs)

Prepare data for CRT analysis with performance optimizations.