[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-salesforce--PyRCA":3,"tool-salesforce--PyRCA":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",151918,2,"2026-04-12T11:33:05",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":77,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":93,"forks":94,"last_commit_at":95,"license":96,"difficulty_score":97,"env_os":98,"env_gpu":99,"env_ram":99,"env_deps":100,"category_tags":106,"github_topics":76,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":108,"updated_at":109,"faqs":110,"releases":149},6962,"salesforce\u002FPyRCA","PyRCA","PyRCA: A Python Machine Learning Library for Root Cause Analysis","PyRCA 是一款专为根因分析（RCA）打造的 Python 机器学习库，旨在帮助工程师快速定位微服务架构中的系统故障源头。随着现代应用日益复杂，数百个服务间的相互依赖使得故障排查变得极具挑战，PyRCA 通过整合先进的算法与端到端流程，有效解决了从海量监控指标中识别异常并追溯根本原因的难题。\n\n该工具主要面向运维工程师（SRE）、后端开发者以及从事系统可靠性研究的研究人员。它目前专注于基于指标的根因分析，内置了多种前沿算法，包括用于并行识别异常指标的ε-Diagnosis，以及基于因果拓扑图的贝叶斯推断和随机游走等方法。此外，PyRCA 还提供了一项独特功能：允许用户结合时间序列数据与领域知识便捷地构建因果图，从而加速图解决方案的开发。\n\n除了提供统一的模型训练与调用接口，PyRCA 还内置了基准测试模块，便于学术界和工业界评估不同 RCA 方法的效果。虽然当前版本侧重于指标分析，但未来计划扩展至链路追踪和日志分析领域。无论是需要快速排查线上故障的实战派，还是希望验证新算法的研究者，PyRCA 都是一个高效且易于上手的专业助手。","# PyRCA: A Python library for Root Cause Analysis\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"#\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.7, 3.8, 3.9-blue\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fsfr-pyrca\">\n  \u003Cimg alt=\"PyPI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fsfr-pyrca.svg\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fopensource.salesforce.com\u002FPyRCA\u002F\">\n  \u003Cimg alt=\"Documentation\" src=\"https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Factions\u002Fworkflows\u002Fdocs.yml\u002Fbadge.svg\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fsfr-pyrca\">\n  \u003Cimg alt=\"Downloads\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsalesforce_PyRCA_readme_3089a5f7d442.png\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.11417\">\n  \u003Cimg alt=\"DOI\" src=\"https:\u002F\u002Fzenodo.org\u002Fbadge\u002FDOI\u002F10.48550\u002FARXIV.2306.11417.svg\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## Table of Contents\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n3. [Getting Started](#getting-started)\n4. [Documentation](https:\u002F\u002Fopensource.salesforce.com\u002FPyRCA\u002F)\n5. [Tutorial](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Ftree\u002Fmain\u002Fexamples)\n6. [Example](#application-example)\n7. [Benchmarks](#benchmarks)\n8. [How to Contribute](#how-to-contribute)\n\n## Introduction\n\nThe adoption of microservices architectures is growing at a rapid pace, making multi-service applications \nthe standard paradigm in real-world IT applications. Typically, a multi-service application consists of \nhundreds of interacting services, making it increasingly challenging to detect service failures and identify \ntheir root causes. Root cause analysis (RCA) methods typically rely on KPI metrics, traces, or logs monitored \non these services to determine the root causes when a system failure is detected. Such methods can aid \nengineers and SREs in the troubleshooting process.\n\nPyRCA is a Python machine-learning library designed to facilitate root cause analysis by offering various \nstate-of-the-art RCA algorithms and an end-to-end pipeline for building RCA solutions. At present, PyRCA \nprimarily focuses on metric-based RCA, including two types of algorithms: (1) identifying anomalous metrics \nin parallel with the observed anomaly through metric data analysis, such as ε-diagnosis, and (2) identifying \nroot causes based on a topology\u002Fcausal graph representing the causal relationships between the observed \nmetrics, such as Bayesian inference and Random Walk. PyRCA also provides a convenient tool for building \ncausal graphs from the observed time series data and domain knowledge, enabling users to develop graph-based \nsolutions quickly. Furthermore, PyRCA offers a benchmark for evaluating various RCA methods, which is \nvaluable for industry and academic research.\n\nThe following list shows the supported RCA methods in our library:\n1. [ε-Diagnosis](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3308558.3313653)\n2. Bayesian Inference-based RCA (BI)\n3. Random Walk-based RCA (RW)\n4. [Root Cause Discovery method (RCD)](https:\u002F\u002Fopenreview.net\u002Fpdf?id=weoLjoYFvXY)\n5. [Hypothesis Testing-based RCA (HT)](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3534678.3539041)\n\nWe will continue improving this library to make it more comprehensive in the future. In the future, \nPyRCA will support trace and log-based RCA methods as well.\n\n## Installation\n\nYou can install ``pyrca`` from PyPI by calling ``pip install sfr-pyrca``. You may install from source by\ncloning the PyRCA repo, navigating to the root directory, and calling\n``pip install .``, or ``pip install -e .`` to install in editable mode. You may install additional dependencies:\n\n- **For plotting & visualization**: Calling ``pip install sfr-pyrca[plot]``, or ``pip install .[plot]`` from the\n  root directory of the repo.\n- **Install all the dependencies**: Calling ``pip install sfr-pyrca[all]``, or ``pip install .[all]`` from the\n  root directory of the repo.\n\n## Getting Started\n\nPyRCA provides a unified interface for training RCA models and finding root causes. To apply\na certain RCA method, you only need to specify: \n\n- **The selected RCA method**: e.g., ``BayesianNetwork``, ``EpsilonDiagnosis``.\n- **The method configuration**: e.g., ``BayesianNetworkConfig``, ``EpsilonDiagnosisConfig``.\n- **Time series data for initialization\u002Ftraining**: e.g., A time series data in a \n  pandas dataframe.\n- **Abnormal time series data in an incident window**: The RCA methods require the anomalous \n  KPI metrics in an incident window.\n\nLet's take ``BayesianNetwork`` as an example. Suppose that ``graph_df`` is the pandas dataframe of\na graph representing the causal relationships between metrics (how to construct such causal graph\nwill be discussed later), and ``df`` is the pandas dataframe containing the historical observed time series \ndata (e.g., the index is the timestamp and each column represents one monitored metric). To train a \n``BayesianNetwork``, you can simply run the following code:\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\nmodel = BayesianNetwork(config=BayesianNetwork.config_class(graph=graph_df))\nmodel.train(df)\nmodel.save(\"model_folder\")\n```\n\nAfter the model is trained, you can use it to find root causes of an incident given a list of anomalous\nmetrics detected by a certain anomaly detector (you can use the stats-based detector supported in PyRCA\nor other anomaly detection methods supported by our [Merlion](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FMerlion) library), \ne.g.,\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\nmodel = BayesianNetwork.load(\"model_folder\")\nresults = model.find_root_causes([\"observed_anomalous_metric\", ...])\nprint(results.to_dict())\n```\n\nFor other RCA methods, you can write similar code as above for finding root causes. For example, if you want\nto try ``EpsilonDiagnosis``, you can initalize ``EpsilonDiagnosis`` as follows:\n\n```python\nfrom pyrca.analyzers.epsilon_diagnosis import EpsilonDiagnosis\nmodel = EpsilonDiagnosis(config=EpsilonDiagnosis.config_class(alpha=0.01))\nmodel.train(normal_data)\n```\n\nHere ``normal_data`` is the historically observed time series data without anomalies. To identify root causes,\nyou can run:\n\n```python\nresults = model.find_root_causes(abnormal_data)\nprint(results.to_dict())\n```\n\nwhere ``abnormal_data`` is the time series data collected in an incident window.\n\nAs mentioned above, some RCA methods such as ``BayesianNetwork`` require causal graphs as their inputs. To construct such causal\ngraphs from the observed time series data, you can utilize our tool by running ``python -m pyrca.tools``.\nThis command will launch a Dash app for time series data analysis and causal discovery.\n![alt text](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsalesforce_PyRCA_readme_48cd3edc6685.gif)\n\nThe dashboard enables users to experiment with different causal discovery methods, customize causal discovery \nparameters, add domain knowledge constraints (e.g., root\u002Fleaf nodes, forbidden\u002Frequired links), and visualize \nthe generated causal graphs. This feature simplifies the process of manually revising causal graphs based on \ndomain knowledge. Users can download the graph generated by this tool if they are satisfied with it. The graph \ncan then be used by the RCA methods supported in PyRCA.\n\nAlternatively, users can write code to build such graphs instead of using the dashboard. The package \n``pyrca.graphs.causal`` includes several popular causal discovery methods that users can leverage. \nAll of these methods support domain knowledge constraints. For instance, if users wish to apply the PC \nalgorithm for building causal graphs on the observed time series data ``df``, the following code can be used:\n\n```python\nfrom pyrca.graphs.causal.pc import PC\nmodel = PC(PC.config_class())\ngraph_df = model.train(df)\n```\n\nIf you have some domain knowledge constraints, you may run:\n\n```python\nfrom pyrca.graphs.causal.pc import PC\nmodel = PC(PC.config_class(domain_knowledge_file=\"file_path\"))\ngraph_df = model.train(df)\n```\n\nThe domain knowledge file has a YAML format, e.g.,\n\n```yaml\ncausal-graph:\n  root-nodes: [\"A\", \"B\"]\n  leaf-nodes: [\"E\", \"F\"]\n  forbids:\n    - [\"A\", \"E\"]\n  requires: \n    - [\"A\", \"C\"]\n```\n\nThis domain knowledge file states that: \n1. Metrics A and B must the root nodes, \n2. Metrics E and F must be the leaf nodes,\n3. There is no connection from A to E, and \n4. There is a connection from A to C. \n\nYou can write your domain knowledge file based on this template for generating more reliable causal\ngraphs.\n\n## Application Example\n\n[Here](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Ftree\u002Fmain\u002Fpyrca\u002Fapplications\u002Fexample) is a real-world example\nof applying ``BayesianNetwork`` to build a solution for RCA, which is adapted from our internal use cases. \nThe \"config\" folder includes the settings for the stats-based anomaly detector and the domain knowledge. \nThe \"models\" folder stores the causal graph and the trained Bayesian network. The ``RCAEngine`` class in the \"rca.py\" \nfile implements the methods for building causal graphs, training Bayesian networks and finding root causes \nby utilizing the modules provided by PyRCA. You can directly use this class if the stats-based anomaly detector \nand Bayesian inference are suitable for your problems. For example, given a time series dataframe ``df``, \nyou can build and train a Bayesian network via the following code:\n\n```python\nfrom pyrca.applications.example.rca import RCAEngine\nengine = RCAEngine()\nengine.build_causal_graph(\n    df=df,\n    run_pdag2dag=True,\n    max_num_points=5000000,\n    verbose=True\n)\nbn = engine.train_bayesian_network(dfs=[df])\nbn.print_probabilities()\n```\n\nAfter the Bayesian network is constructed, you can use it directly for finding root causes:\n\n```python\nengine = RCAEngine()\nresult = engine.find_root_causes_bn(anomalies=[\"conn_pool\", \"apt\"])\npprint.pprint(result)\n```\n\nThe inputs of ``find_root_causes_bn`` is a list of the anomalous metrics detected by the stats-based\nanomaly detector. This method will estimate the probability of a node being a root cause and extract\nthe paths from a potential root cause node to the leaf nodes.\n\n## Benchmarks\n\nThe following table summarizes the RCA performance of different methods on the simulated dataset.\nHow to generate the simulated dataset can be found [here](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fblob\u002Fmain\u002Fexamples\u002FDataGeneration.ipynb),\nand how to test different RCA methods can be found [here](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fblob\u002Fmain\u002Fexamples\u002FRoot%20Cause%20Analysis.ipynb).\n\n\u003Cdiv align=\"center\">\n\n|                             |  Recall@1   |  Recall@3   |  Recall@5   |\n:---------------------------:|:-----------:|:-----------:|:-----------:\n|         ε-Diagnosis         | 0.06 ± 0.02 | 0.16 ± 0.04 | 0.16 ± 0.04 |\n|             RCD             | 0.28 ± 0.05 | 0.29 ± 0.05 | 0.30 ± 0.05 |\n|          Local-RCD          | 0.44 ± 0.05 | 0.70 ± 0.05 | 0.70 ± 0.05 |\n|         Random Walk         | 0.07 ± 0.03 | 0.20 ± 0.04 | 0.24 ± 0.04 |\n|      Random Walk (PC)       | 0.06 ± 0.02 | 0.17 ± 0.04 | 0.21 ± 0.04 |\n|     Bayesian Inference      | 0.15 ± 0.04 | 0.35 ± 0.05 | 0.43 ± 0.05 |\n|   Bayesian Inference (PC)   | 0.11 ± 0.03 | 0.30 ± 0.05 | 0.40 ± 0.05 |\n|     Hypothesis-testing      | 1.00 ± 0.00 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n|   Hypothesis-testing (PC)   | 0.95 ± 0.02 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n|  Hypothesis-testing (ADJ)   | 0.95 ± 0.02 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n| Hypothesis-testing (ADJ-PC) | 0.77 ± 0.04 | 0.92 ± 0.03 | 0.92 ± 0.03 |\n\n\u003C\u002Fdiv>\n\nε-Diagnosis and RCD are one-phase RCA methods, while the rest methods are two-phase RCA methods. \nLocal-RCD denotes the RCD algorithm with localized learning. The Bayesian Inference algorithm \ncomputes the root cause scores by estimating each structural causal model. Hypothesis-testing (ADJ) denotes \nthe hypothesis-testing algorithm with descendant adjustment. For the two-phase models, the algorithms \nwithout suffix indicate that the root cause localization algorithm use the true causal graph for model \ntraining. The algorithms with suffix \"PC\" indicate the causal graph is estimated via PC algorithm.\n\n## How to Contribute\n\nWe welcome the contribution from the open-source community to improve the library!\nBefore you get started, clone this repo, run `pip install pre-commit`, and run `pre-commit install` \nfrom the root directory of the repo. This will ensure all files are formatted correctly and contain \nthe appropriate license headers whenever you make a commit. \n\nTo add a new RCA method into the library, you may follow the steps below:\n1. Create a new python script file for this RCA method in the ``pyrca\u002Fanalyzers`` folder.\n2. Create the configuration class inheriting from ``pyrca.base.BaseConfig``.\n3. Create the method class inheriting from ``pyrca.analyzers.base.BaseRCA``. The constructor for the new \nmethod takes the new configuration instance as its input.\n4. Implement the ``train`` function that trains or initializes the new method.\n5. Implement the ``find_root_causes`` function that returns a ``pyrca.analyzers.base.RCAResults`` \ninstance for root cause analysis results.\n\nTo add a new causal discovery method, you may follow the following steps:\n1. Create a new python script file for this RCA method in the ``pyrca\u002Fgraphs\u002Fcausal`` folder.\n2. Create the configuration class that inherits from ``pyrca.graphs.causal.base.CausalModelConfig``.\n3. Create the method class that inherits from ``pyrca.graphs.causal.base.CausalModel``. \nThe constructor for the new method takes the new configuration instance as its input.\n4. Implement the ``_train`` function that returns the discovered casual graph. The input parameters\nof ``_train`` are the time series dataframe, the lists of forbidden and required links, and other\nadditional parameters.\n\n## Contact Us\nIf you have any questions, comments or suggestions, please do not hesitate to contact us at pyrca@salesforce.com.\n\n## License\n[BSD 3-Clause License](LICENSE)\n","# PyRCA：用于根本原因分析的 Python 库\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"#\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.7, 3.8, 3.9-blue\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fsfr-pyrca\">\n  \u003Cimg alt=\"PyPI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fsfr-pyrca.svg\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fopensource.salesforce.com\u002FPyRCA\u002F\">\n  \u003Cimg alt=\"文档\" src=\"https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Factions\u002Fworkflows\u002Fdocs.yml\u002Fbadge.svg\"\u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fsfr-pyrca\">\n  \u003Cimg alt=\"下载量\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsalesforce_PyRCA_readme_3089a5f7d442.png\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.11417\">\n  \u003Cimg alt=\"DOI\" src=\"https:\u002F\u002Fzenodo.org\u002Fbadge\u002FDOI\u002F10.48550\u002FARXIV.2306.11417.svg\"\u002F>\n  \u003C\u002Fa>\n\u003C\u002Fdiv>\n\n## 目录\n1. [简介](#introduction)\n2. [安装](#installation)\n3. [快速入门](#getting-started)\n4. [文档](https:\u002F\u002Fopensource.salesforce.com\u002FPyRCA\u002F)\n5. [教程](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Ftree\u002Fmain\u002Fexamples)\n6. [应用示例](#application-example)\n7. [基准测试](#benchmarks)\n8. [如何贡献](#how-to-contribute)\n\n## 简介\n\n微服务架构的应用正以迅猛的速度增长，多服务应用程序已成为现实世界 IT 应用中的标准范式。通常，一个多服务应用程序由数百个相互协作的服务组成，这使得检测服务故障并确定其根本原因变得越来越困难。根本原因分析（RCA）方法通常依赖于在这些服务上监控的关键绩效指标、跟踪数据或日志，以便在检测到系统故障时确定根本原因。此类方法可以帮助工程师和 SRE 在故障排除过程中提高效率。\n\nPyRCA 是一个基于 Python 的机器学习库，旨在通过提供多种最先进的 RCA 算法以及构建 RCA 解决方案的端到端流程，来促进根本原因分析工作。目前，PyRCA 主要专注于基于指标的 RCA，包括两类算法：(1) 通过指标数据分析，在观察到异常的同时识别出异常指标，例如 ε-诊断；(2) 基于表示观测指标之间因果关系的拓扑图或因果图来识别根本原因，例如贝叶斯推断和随机游走。PyRCA 还提供了一个便捷的工具，用于从观测的时间序列数据和领域知识中构建因果图，使用户能够快速开发基于图的解决方案。此外，PyRCA 提供了一个用于评估各种 RCA 方法的基准测试，这对工业界和学术研究都具有重要价值。\n\n以下列出了我们库中支持的 RCA 方法：\n1. [ε-诊断](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3308558.3313653)\n2. 基于贝叶斯推断的 RCA（BI）\n3. 基于随机游走的 RCA（RW）\n4. [根因发现方法（RCD）](https:\u002F\u002Fopenreview.net\u002Fpdf?id=weoLjoYFvXY)\n5. [基于假设检验的 RCA（HT）](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3534678.3539041)\n\n我们将继续改进这个库，使其在未来更加全面。未来，PyRCA 还将支持基于跟踪和日志的 RCA 方法。\n\n## 安装\n\n您可以通过运行 `pip install sfr-pyrca` 从 PyPI 安装 `pyrca`。您也可以从源代码安装：克隆 PyRCA 仓库，进入根目录，然后运行 `pip install .`，或者使用 `pip install -e .` 以可编辑模式安装。您还可以安装额外的依赖项：\n\n- **用于绘图与可视化**：运行 `pip install sfr-pyrca[plot]`，或从仓库根目录运行 `pip install .[plot]`。\n- **安装所有依赖项**：运行 `pip install sfr-pyrca[all]`，或从仓库根目录运行 `pip install .[all]`。\n\n## 快速入门\n\nPyRCA 提供了一个统一的接口，用于训练 RCA 模型和查找根本原因。要应用某种 RCA 方法，您只需指定：\n\n- **所选的 RCA 方法**：例如，``BayesianNetwork``、``EpsilonDiagnosis``。\n- **方法配置**：例如，``BayesianNetworkConfig``、``EpsilonDiagnosisConfig``。\n- **用于初始化\u002F训练的时间序列数据**：例如，一个 Pandas DataFrame 格式的时间序列数据。\n- **事件窗口中的异常时间序列数据**：RCA 方法需要事件窗口内的异常 KPI 指标。\n\n我们以 ``BayesianNetwork`` 为例。假设 ``graph_df`` 是表示指标之间因果关系的图的 Pandas DataFrame（如何构建此类因果图将在稍后讨论），而 ``df`` 是包含历史观测时间序列数据的 Pandas DataFrame（例如，索引为时间戳，每列代表一个被监控的指标）。要训练一个 ``BayesianNetwork``，您可以简单地运行以下代码：\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\nmodel = BayesianNetwork(config=BayesianNetwork.config_class(graph=graph_df))\nmodel.train(df)\nmodel.save(\"model_folder\")\n```\n\n模型训练完成后，您可以使用它来查找由某个异常检测器检测到的一组异常指标所对应的事件的根本原因（您可以使用 PyRCA 中支持的基于统计的检测器，或我们 [Merlion](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FMerlion) 库中支持的其他异常检测方法），例如：\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\nmodel = BayesianNetwork.load(\"model_folder\")\nresults = model.find_root_causes([\"observed_anomalous_metric\", ...])\nprint(results.to_dict())\n```\n\n对于其他 RCA 方法，您可以编写与上述类似的代码来查找根本原因。例如，如果您想尝试 ``EpsilonDiagnosis``，可以按如下方式初始化 ``EpsilonDiagnosis``：\n\n```python\nfrom pyrca.analyzers.epsilon_diagnosis import EpsilonDiagnosis\nmodel = EpsilonDiagnosis(config=EpsilonDiagnosis.config_class(alpha=0.01))\nmodel.train(normal_data)\n```\n\n这里，``normal_data`` 是历史上观测到的无异常的时间序列数据。要识别根本原因，您可以运行：\n\n```python\nresults = model.find_root_causes(abnormal_data)\nprint(results.to_dict())\n```\n\n其中，``abnormal_data`` 是在事件窗口内收集的时间序列数据。\n\n如上所述，某些 RCA 方法（如 ``BayesianNetwork``）需要将因果图作为输入。要从观测到的时间序列数据中构建此类因果图，您可以使用我们的工具，运行 ``python -m pyrca.tools``。该命令将启动一个用于时间序列数据分析和因果发现的 Dash 应用程序。\n![alt text](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsalesforce_PyRCA_readme_48cd3edc6685.gif)\n\n该仪表板使用户能够尝试不同的因果发现方法、自定义因果发现参数、添加领域知识约束（例如根节点\u002F叶节点、禁止\u002F必须存在的边），并可视化生成的因果图。此功能简化了基于领域知识手动修订因果图的过程。如果用户对工具生成的图满意，可以将其下载下来，随后该图可被 PyRCA 支持的 RCA 方法使用。\n\n或者，用户也可以不使用仪表板，而是直接编写代码来构建此类图。包 ``pyrca.graphs.causal`` 包含了几种流行的因果发现方法，用户可以加以利用。所有这些方法都支持领域知识约束。例如，如果用户希望在观测到的时间序列数据 ``df`` 上应用 PC 算法来构建因果图，可以使用以下代码：\n\n```python\nfrom pyrca.graphs.causal.pc import PC\nmodel = PC(PC.config_class())\ngraph_df = model.train(df)\n```\n\n如果您有一些领域知识约束，可以运行：\n\n```python\nfrom pyrca.graphs.causal.pc import PC\nmodel = PC(PC.config_class(domain_knowledge_file=\"file_path\"))\ngraph_df = model.train(df)\n```\n\n领域知识文件采用 YAML 格式，例如：\n\n```yaml\ncausal-graph:\n  root-nodes: [\"A\", \"B\"]\n  leaf-nodes: [\"E\", \"F\"]\n  forbids:\n    - [\"A\", \"E\"]\n  requires: \n    - [\"A\", \"C\"]\n```\n\n该领域知识文件说明：\n1. 指标 A 和 B 必须是根节点，\n2. 指标 E 和 F 必须是叶节点，\n3. A 和 E 之间不能有连接，\n4. A 和 C 之间必须存在连接。\n\n您可以根据此模板编写自己的领域知识文件，以生成更可靠的因果图。\n\n## 应用示例\n\n[这里](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Ftree\u002Fmain\u002Fpyrca\u002Fapplications\u002Fexample)是一个将 ``BayesianNetwork`` 应用于构建 RCA 解决方案的真实世界示例，该示例改编自我们的内部用例。其中，“config”文件夹包含基于统计的异常检测器的设置以及领域知识；“models”文件夹则存储因果图和训练好的贝叶斯网络。“rca.py”文件中的 ``RCAEngine`` 类实现了利用 PyRCA 提供的模块来构建因果图、训练贝叶斯网络以及查找根本原因的方法。如果基于统计的异常检测器和贝叶斯推理适合您的问题，您可以直接使用该类。例如，给定一个时间序列 DataFrame ``df``，您可以通过以下代码构建并训练一个贝叶斯网络：\n\n```python\nfrom pyrca.applications.example.rca import RCAEngine\nengine = RCAEngine()\nengine.build_causal_graph(\n    df=df,\n    run_pdag2dag=True,\n    max_num_points=5000000,\n    verbose=True\n)\nbn = engine.train_bayesian_network(dfs=[df])\nbn.print_probabilities()\n```\n\n贝叶斯网络构建完成后，您可以直接用它来查找根本原因：\n\n```python\nengine = RCAEngine()\nresult = engine.find_root_causes_bn(anomalies=[\"conn_pool\", \"apt\"])\npprint.pprint(result)\n```\n\n``find_root_causes_bn`` 的输入是一组由基于统计的异常检测器检测到的异常指标。该方法会估计某个节点成为根本原因的概率，并提取从潜在的根本原因节点到叶节点的路径。\n\n## 基准测试\n\n下表总结了不同方法在模拟数据集上的根因分析性能。  \n如何生成模拟数据集可以参见[这里](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fblob\u002Fmain\u002Fexamples\u002FDataGeneration.ipynb)，  \n而如何测试不同的根因分析方法则可以参见[这里](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fblob\u002Fmain\u002Fexamples\u002FRoot%20Cause%20Analysis.ipynb)。\n\n\u003Cdiv align=\"center\">\n\n|                             |  召回率@1   |  召回率@3   |  召回率@5   |\n:---------------------------:|:-----------:|:-----------:|:-----------:\n|         ε-Diagnosis         | 0.06 ± 0.02 | 0.16 ± 0.04 | 0.16 ± 0.04 |\n|             RCD             | 0.28 ± 0.05 | 0.29 ± 0.05 | 0.30 ± 0.05 |\n|          Local-RCD          | 0.44 ± 0.05 | 0.70 ± 0.05 | 0.70 ± 0.05 |\n|         Random Walk         | 0.07 ± 0.03 | 0.20 ± 0.04 | 0.24 ± 0.04 |\n|      Random Walk (PC)       | 0.06 ± 0.02 | 0.17 ± 0.04 | 0.21 ± 0.04 |\n|     Bayesian Inference      | 0.15 ± 0.04 | 0.35 ± 0.05 | 0.43 ± 0.05 |\n|   Bayesian Inference (PC)   | 0.11 ± 0.03 | 0.30 ± 0.05 | 0.40 ± 0.05 |\n|     Hypothesis-testing      | 1.00 ± 0.00 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n|   Hypothesis-testing (PC)   | 0.95 ± 0.02 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n|  Hypothesis-testing (ADJ)   | 0.95 ± 0.02 | 1.00 ± 0.00 | 1.00 ± 0.00 |\n| Hypothesis-testing (ADJ-PC) | 0.77 ± 0.04 | 0.92 ± 0.03 | 0.92 ± 0.03 |\n\n\u003C\u002Fdiv>\n\nε-Diagnosis 和 RCD 属于单阶段的根因分析方法，而其余方法均为双阶段的根因分析方法。  \nLocal-RCD 表示采用局部学习的 RCD 算法。Bayesian Inference 算法通过估计每个结构因果模型来计算根因得分。Hypothesis-testing (ADJ) 表示带有后代调整的假设检验算法。对于双阶段模型，未带后缀的算法表示根因定位算法使用真实因果图进行模型训练。而带有“PC”后缀的算法则表示因果图是通过 PC 算法估计得到的。\n\n## 如何贡献\n\n我们欢迎开源社区为改进本库做出贡献！  \n在开始之前，请先克隆本仓库，运行 `pip install pre-commit`，并在仓库的根目录下执行 `pre-commit install`。这将确保您每次提交时，所有文件都格式正确，并包含适当的许可证头信息。\n\n要向本库添加新的根因分析方法，您可以按照以下步骤操作：\n1. 在 ``pyrca\u002Fanalyzers`` 文件夹中为该根因分析方法创建一个新的 Python 脚本文件。\n2. 创建一个继承自 ``pyrca.base.BaseConfig`` 的配置类。\n3. 创建一个继承自 ``pyrca.analyzers.base.BaseRCA`` 的方法类。新方法的构造函数应以新的配置实例作为输入。\n4. 实现 ``train`` 函数，用于训练或初始化新方法。\n5. 实现 ``find_root_causes`` 函数，该函数应返回一个 ``pyrca.analyzers.base.RCAResults`` 实例，用于存储根因分析结果。\n\n要添加新的因果发现方法，您可以按照以下步骤操作：\n1. 在 ``pyrca\u002Fgraphs\u002Fcausal`` 文件夹中为该因果发现方法创建一个新的 Python 脚本文件。\n2. 创建一个继承自 ``pyrca.graphs.causal.base.CausalModelConfig`` 的配置类。\n3. 创建一个继承自 ``pyrca.graphs.causal.base.CausalModel`` 的方法类。新方法的构造函数应以新的配置实例作为输入。\n4. 实现 ``_train`` 函数，该函数应返回发现的因果图。``_train`` 函数的输入参数包括时间序列数据框、禁止和必须存在的边列表以及其他附加参数。\n\n## 联系我们\n如果您有任何问题、意见或建议，请随时通过 pyrca@salesforce.com 与我们联系。\n\n## 许可证\n[BSD 3-Clause 许可证](LICENSE)","# PyRCA 快速上手指南\n\nPyRCA 是一个用于根因分析（Root Cause Analysis, RCA）的 Python 机器学习库，专为微服务架构设计。它提供多种先进的算法（如贝叶斯推断、随机游走、ε-Diagnosis 等），帮助工程师通过指标数据快速定位系统故障的根本原因。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：3.7, 3.8 或 3.9\n*   **前置依赖**：\n    *   `pandas`：用于处理时间序列数据\n    *   `numpy`：数值计算基础\n    *   （可选）绘图依赖：若需使用可视化功能，需安装额外绘图库\n\n> **提示**：国内用户建议使用清华源或阿里源加速安装过程。\n\n## 安装步骤\n\n您可以通过 PyPI 直接安装，也可以从源码安装。\n\n### 方式一：通过 PyPI 安装（推荐）\n\n使用 pip 安装核心库：\n```bash\npip install sfr-pyrca -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n若需要**绘图与可视化**功能：\n```bash\npip install \"sfr-pyrca[plot]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n若需要安装**所有依赖**：\n```bash\npip install \"sfr-pyrca[all]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 方式二：从源码安装\n\n克隆仓库并进入根目录：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA.git\ncd PyRCA\n```\n\n安装为可编辑模式（适合开发者）：\n```bash\npip install -e . -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\nPyRCA 提供了统一的接口来训练模型和查找根因。以下以 **贝叶斯网络 (BayesianNetwork)** 为例，展示最简化的工作流程。\n\n### 1. 准备数据\n假设您有一个包含历史监控指标的 Pandas DataFrame (`df`)，索引为时间戳，列为各项指标。同时假设您已有一个表示因果关系的图数据 (`graph_df`)。\n\n### 2. 训练模型\n初始化模型配置并训练：\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\n\n# 初始化模型，传入因果图配置\nmodel = BayesianNetwork(config=BayesianNetwork.config_class(graph=graph_df))\n\n# 使用历史正常数据进行训练\nmodel.train(df)\n\n# 保存模型\nmodel.save(\"model_folder\")\n```\n\n### 3. 查找根因\n加载训练好的模型，并输入检测到的异常指标列表进行根因分析：\n\n```python\nfrom pyrca.analyzers.bayesian import BayesianNetwork\n\n# 加载模型\nmodel = BayesianNetwork.load(\"model_folder\")\n\n# 输入检测到的异常指标列表\nresults = model.find_root_causes([\"observed_anomalous_metric\", \"another_metric\"])\n\n# 输出结果\nprint(results.to_dict())\n```\n\n### 进阶：构建因果图\n如果您的场景没有现成的因果图，可以使用 PyRCA 内置工具基于时间序列数据自动生成。\n\n**方法 A：使用命令行可视化工具（推荐）**\n运行以下命令启动 Dash 应用，通过界面交互式生成因果图：\n```bash\npython -m pyrca.tools\n```\n\n**方法 B：代码自动生成**\n使用 PC 算法自动构建因果图：\n```python\nfrom pyrca.graphs.causal.pc import PC\n\nmodel = PC(PC.config_class())\ngraph_df = model.train(df)\n```\n\n若需加入领域知识约束（如指定根节点、禁止某些连接），可创建 YAML 配置文件并在 `config_class` 中指定 `domain_knowledge_file` 路径。","某电商平台的 SRE 团队在“双十一”大促期间，面对由数百个微服务组成的复杂交易系统，急需在突发流量高峰导致的服务延迟中快速定位故障根源。\n\n### 没有 PyRCA 时\n- **人工排查效率低下**：工程师需手动登录多个监控系统，逐一对比数百项 KPI 指标，耗时数小时才能缩小怀疑范围。\n- **误判率高**：缺乏科学的因果推断，往往将受影响的下游服务误判为故障源头，导致修复方向错误，业务中断时间延长。\n- **依赖专家经验**：故障定位高度依赖资深人员的个人经验，新人难以独立处理，且无法将排查逻辑标准化复用。\n- **拓扑关系模糊**：服务间的调用链和因果依赖仅存在于文档或老员工脑中，缺乏基于实时数据构建的动态因果图辅助决策。\n\n### 使用 PyRCA 后\n- **自动化根因定位**：利用 PyRCA 内置的 ε-Diagnosis 算法并行分析异常指标，系统在分钟级内自动锁定引发延迟的核心数据库连接池服务。\n- **精准因果推断**：通过贝叶斯推理（Bayesian Inference）结合实时拓扑图，准确区分“病因”与“症状”，避免了对正常下游服务的无效重启。\n- **降低门槛与标准化**：统一的 Python 接口让初级工程师也能调用先进的 RCA 算法，将排查流程固化为可复用的代码脚本。\n- **动态图谱构建**：直接利用观测到的时间序列数据自动构建因果图，实时反映微服务间的依赖变化，无需人工维护静态拓扑文档。\n\nPyRCA 将原本需要数小时的人工“大海捞针”式排查，转化为分钟级的自动化精准诊断，显著提升了微服务架构下的系统稳定性与运维效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsalesforce_PyRCA_48cd3edc.gif","salesforce","Salesforce","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsalesforce_6ff2d82a.png","Noteworthy Open Source projects made available by Salesforce. Available under Open Source or Creative Commons licensing. No warranty or support implied",null,"osscore@salesforce.com","https:\u002F\u002Fopensource.salesforce.com","https:\u002F\u002Fgithub.com\u002Fsalesforce",[81,85,89],{"name":82,"color":83,"percentage":84},"Python","#3572A5",93.2,{"name":86,"color":87,"percentage":88},"CSS","#663399",6.7,{"name":90,"color":91,"percentage":92},"JavaScript","#f1e05a",0.1,545,66,"2026-04-10T14:41:59","BSD-3-Clause",1,"","未说明",{"notes":101,"python":102,"dependencies":103},"该工具主要基于统计学习和因果发现算法，未提及需要 GPU 加速。安装时可通过 'sfr-pyrca[plot]' 安装绘图依赖，或通过 'sfr-pyrca[all]' 安装所有依赖。部分功能（如因果图构建）提供 Dash 可视化界面。","3.7, 3.8, 3.9",[104,105],"pandas","dash",[14,107],"其他","2026-03-27T02:49:30.150509","2026-04-13T06:09:55.142745",[111,116,121,126,131,136,140,144],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},31385,"安装时遇到 `javabridge` 包报错或无法安装怎么办？","这是一个已知问题。维护者已将 `javabridge` 依赖替换为更可靠的 `jpype`。请尝试安装最新版本（从源码安装或等待 PyPI 更新），新版本不再需要 `javabridge`。如果您不需要运行 FGES 算法，也可以不安装该依赖。如果必须使用旧版本，可以尝试手动安装：`pip install git+https:\u002F\u002Fgithub.com\u002FLeeKamentsky\u002Fpython-javabridge`。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F25",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},31386,"运行示例代码时出现 'NoneType' object is not subscriptable 错误如何解决？","这通常是因为数据加载或处理过程中出现了空值。请确保您的数据文件（如 CSV）格式正确，没有缺失值（NaN）或空行。此外，检查字段名称中是否包含空格，字段名不应含有空格。如果问题依旧，建议先清洗数据，去除 NaN 值和分类数据后再尝试运行因果发现算法。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F30",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},31387,"导入模块时出现 `ModuleNotFoundError: No module named 'pyrca.graphs'` 错误？","这通常是因为安装了错误的库或环境配置有问题。请执行以下命令卸载旧版本并重新安装正确的包：`pip uninstall pyrca` 然后 `pip install sfr-pyrca[all]`。确保运行代码的 Python 环境与安装包的环境一致。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F34",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},31388,"运行 `DataGeneration.ipynb` 示例时出现 `AttributeError: 'NoneType' object has no attribute 'integers'` 错误？","这是示例笔记本中的一个代码错误。请将出错行的代码 `graph_matrix = DAGGen(DAGGenConfig).gen()` 修改为 `graph_matrix = DAGGen(DAGGenConfig()).gen()`（注意 `DAGGenConfig` 后需要加括号进行实例化）。该问题在主分支中已被修复。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F37",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},31389,"PyRCA 是否支持包含 NaN（空值）的数据集生成因果图？","不支持。根据社区测试反馈，输入数据不应包含 NaN、null 值或分类数据（categorical data）。此外，字段名称中间也不能有空格。在使用工具前，请务必对数据进行预处理，填充或删除空值，并将字段名规范化。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F57",{"id":137,"question_zh":138,"answer_zh":139,"source_url":120},31390,"生成的因果图中箭头方向代表什么含义？","在生成的因果图中，父节点（Parent nodes）代表原因（Causes），子节点（Children）代表结果（Effects）。因此，箭头的方向是从原因指向结果，这与某些服务拓扑图中的流向可能不同，请注意区分。",{"id":141,"question_zh":142,"answer_zh":143,"source_url":120},31391,"Dashboard 生成的因果发现结果不准确怎么办？","由于数据噪声或其他数据问题，自动生成的因果发现结果通常不够准确。该工具设计初衷是结合领域知识来优化结果。如果发现错误，您可以迭代地修正图表，通过添加约束条件（constraints）来调整和优化因果图结构。",{"id":145,"question_zh":146,"answer_zh":147,"source_url":148},31392,"在 Windows 上运行 `python -m pyrca.tools` 启动 Dashboard 时遇到 socket 权限错误？","该错误提示 \"An attempt was made to access a socket in a way forbidden by its access permissions\" 通常是因为端口被占用或防火墙限制。默认端口是 8050。您可以尝试更换端口运行，或者检查是否有其他程序占用了该端口。如果问题持续，可能需要以管理员身份运行终端或检查 Windows 防火墙设置。","https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FPyRCA\u002Fissues\u002F56",[150,155,160],{"id":151,"version":152,"summary_zh":153,"released_at":154},231093,"v1.0.1","修复了一个安装问题，并更新了一些文档。","2023-06-27T02:26:33",{"id":156,"version":157,"summary_zh":158,"released_at":159},231094,"v1.0.0","PyRCA 的第一个版本","2023-05-18T06:28:32",{"id":161,"version":162,"summary_zh":163,"released_at":164},231095,"v0.0.1","PyRCA 的初始版本","2023-04-27T06:54:46"]