API Reference

This section provides a detailed API reference for the ConversionFlow library, automatically generated from the docstrings in the source code.

Data Processing

This module handles loading and preprocessing of the data.

Models

This module contains the implementation of the Bayesian Network model.

Optimization

This module includes the optimization pipeline.

Orchestration

This module orchestrates the full pipeline.

Utilities

This module provides various utility functions.

src.utils.run_diagnostics(idata)[source]

Run comprehensive MCMC diagnostics on an InferenceData object.

Parameters:

idata (arviz.InferenceData) – The InferenceData object containing the MCMC samples

Returns:

Dictionary containing various diagnostic metrics

Return type:

dict

src.utils.analyze_results(results, output_dir, config, preprocessing_stats, data)[source]

Analyze and save results.

src.utils.analyze_results_gemini(analysis_data, gemini_api_key, output_dir)[source]

Analyzes the given results using the Google Gemini API and returns a text analysis along with recommendations. Displays formatted results in terminal and saves to file.

Parameters:
  • analysis_data (dict) – The results from the model.

  • gemini_api_key (str) – Your Google Gemini API key.

  • output_dir (str) – Directory to save the analysis text file.

Returns:

The analysis and recommendations from Gemini.

Return type:

str