Bayesian MCP

Integrations

  • Uses FastAPI to expose the Bayesian MCP server API endpoints for model creation, belief updating, prediction generation, model comparison, and visualization.

  • Provides installation instructions for cloning the repository from GitHub to set up the Bayesian MCP server.

  • Utilizes NumPy for numerical computations in Bayesian inference, handling arrays and mathematical operations for probabilistic models.

ベイジアンMCP

ベイズ推論、推論、および信念更新のためのモデル呼び出しプロトコル(MCP)サーバー。このツールにより、LLMは厳密なベイズ分析と確率推論を実行できます。

特徴

  • 🧠ベイズ推論:MCMCサンプリングを使用して新しい証拠で信念を更新する
  • 📊モデル比較:情報基準を使用して競合モデルを比較する
  • 🔮予測推論:不確実性の定量化による予測の生成
  • 📈可視化:事後分布の可視化を作成する
  • 🔌 MCP 統合: MCP をサポートするあらゆる LLM とシームレスに統合

インストール

開発インストール

リポジトリをクローンし、依存関係をインストールします。

git clone https://github.com/wrenchchatrepo/bayesian-mcp.git cd bayesian-mcp pip install -e .

要件

  • Python 3.9以上
  • PyMC 5.0以降
  • アルヴィズ
  • ナンパイ
  • Matplotlib
  • ファストAPI
  • ウビコーン

クイックスタート

サーバーの起動

# Run with default settings python bayesian_mcp.py # Specify host and port python bayesian_mcp.py --host 0.0.0.0 --port 8080 # Set log level python bayesian_mcp.py --log-level debug

サーバーは起動し、指定されたホストとポートで MCP 要求をリッスンします。

APIの使用

Bayesian MCP サーバーは、API を通じていくつかの機能を公開します。

1. モデルを作成する

指定された変数を使用して新しいベイズ モデルを作成します。

# MCP Request { "function_name": "create_model", "parameters": { "model_name": "my_model", "variables": { "theta": { "distribution": "normal", "params": {"mu": 0, "sigma": 1} }, "likelihood": { "distribution": "normal", "params": {"mu": "theta", "sigma": 0.5}, "observed": [0.1, 0.2, 0.3, 0.4] } } } }

2. 信念を更新する

新しい証拠に基づいてモデルの信念を更新します。

# MCP Request { "function_name": "update_beliefs", "parameters": { "model_name": "my_model", "evidence": { "data": [0.1, 0.2, 0.3, 0.4] }, "sample_kwargs": { "draws": 1000, "tune": 1000, "chains": 2 } } }

3. 予測する

事後分布を使用して予測を生成します。

# MCP Request { "function_name": "predict", "parameters": { "model_name": "my_model", "variables": ["theta"], "conditions": { "x": [1.0, 2.0, 3.0] } } }

4. モデルを比較する

情報基準を使用して複数のモデルを比較します。

# MCP Request { "function_name": "compare_models", "parameters": { "model_names": ["model_1", "model_2"], "metric": "waic" } }

5. 視覚化を作成する

モデルの事後分布の視覚化を生成します。

# MCP Request { "function_name": "create_visualization", "parameters": { "model_name": "my_model", "plot_type": "trace", "variables": ["theta"] } }

examples/ディレクトリには、Bayesian MCP サーバーの使用方法を示すいくつかの例が含まれています。

線形回帰

パラメータ推定を示す単純な線形回帰の例:

python examples/linear_regression.py

A/Bテスト

コンバージョン率のベイジアン A/B テストの例:

python examples/ab_test.py

サポートされているディストリビューション

ベイジアン エンジンは次の分布をサポートします。

  • normal : 正規(ガウス)分布
  • lognormal :対数正規分布
  • beta :ベータ分布
  • gamma :ガンマ分布
  • exponential :指数分布
  • uniform :均一分布
  • bernoulli :ベルヌーイ分布
  • binomial :二項分布
  • poisson :ポアソン分布
  • deterministic :決定論的変換

MCP統合

このサーバーはモデル呼び出しプロトコルを実装しており、幅広いLLMおよびフレームワークと互換性があります。LLMで使用するには、以下の手順に従ってください。

import requests response = requests.post("http://localhost:8000/mcp", json={ "function_name": "create_model", "parameters": { "model_name": "example_model", "variables": {...} } }) result = response.json()

ライセンス

マサチューセッツ工科大学

クレジット

Wrench AI フレームワークの概念とコードに基づいています。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

LLM が推論、モデル比較、不確実性定量化による予測モデリングなどの厳密なベイズ分析と確率的推論を実行できるようにするモデル呼び出しプロトコル サーバー。

  1. 特徴
    1. インストール
      1. 開発インストール
      2. 要件
    2. クイックスタート
      1. サーバーの起動
    3. APIの使用
      1. モデルを作成する
      2. 信念を更新する
      3. 予測する
      4. モデルを比較する
      5. 視覚化を作成する
      1. 線形回帰
      2. A/Bテスト
    4. サポートされているディストリビューション
      1. MCP統合
        1. ライセンス
          1. クレジット

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.
              Last updated -
              4
              Python
              MIT License
              • Apple
              • Linux
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.
              Last updated -
              13
              2
              TypeScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.
              Last updated -
              1
              48
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              Enables LLMs to perform statistical analysis and generate ML predictions on user data from databases or CSV files through a Model Context Protocol server.
              Last updated -
              Python

            View all related MCP servers

            ID: om8g7ez16q