Model-based Response surface optimization with Bootstrap Sampling - Surface interpolation with XGBoost, gradient ascent path finding, and clustering-based optimal point estimation
Project description
MRBS
Model-based Response surface optimization with Bootstrap Sampling
部分的なデータをXGBoostで補完し、勾配上昇法とクラスタリングで最適点を探索するPythonライブラリです。
特徴
- XGBoost補完: 部分的なサンプリングデータから曲面を補完
- 勾配上昇法: 近傍線形回帰による局所勾配推定で最適点を探索
- クラスタリング: 複数の探索パスの終点をK-Meansでクラスタリングし、最適点候補を算出
インストール
pip install mrbs
開発版のインストール:
git clone https://github.com/yutotakagi/MRBS.git
cd MRBS
pip install -e ".[dev]"
クイックスタート
import numpy as np
import pandas as pd
from mrbs import SurfaceInterpolator, GradientAscentOptimizer, OptimalPointFinder
from mrbs.visualization import plot_optimization_result
# 1. データ読み込み・補完
df = pd.read_csv("data/sphere_sampled_benchmark_xy_F.csv")
X = df[["x", "y"]].values
y = df["F"].values
interpolator = SurfaceInterpolator(n_estimators=300)
interpolator.fit(X, y)
xx, yy, F_grid = interpolator.generate_grid(n_grid=100)
# 2. 勾配上昇パス計算
optimizer = GradientAscentOptimizer(interpolator, n_steps=10, radius=10)
start_points = np.random.uniform(-100, 100, size=(20, 2))
paths = optimizer.compute_paths(start_points)
# 3. クラスタリング・最適点算出
finder = OptimalPointFinder(k_min=1, k_max=5)
result = finder.find_optimal_points(paths)
# 4. 結果表示
print("最適点候補:")
for i, centroid in enumerate(result.centroids):
print(f" Point {i+1}: x={centroid[0]:.4f}, y={centroid[1]:.4f}")
# 5. 可視化
plot_optimization_result(xx, yy, F_grid, result)
モジュール構成
| モジュール | 説明 |
|---|---|
mrbs.interpolator |
SurfaceInterpolator - XGBoostによる曲面補完 |
mrbs.gradient_ascent |
GradientAscentOptimizer - 勾配上昇法による最適点探索 |
mrbs.clustering |
OptimalPointFinder - クラスタリングによる最適点算出 |
mrbs.visualization |
可視化関数 |
依存パッケージ
- Python >= 3.9
- numpy >= 1.20
- pandas >= 1.3
- xgboost >= 1.5
- scikit-learn >= 1.0
- matplotlib >= 3.4
コントリビューション
コントリビューションを歓迎します!詳細は CONTRIBUTING.md をご覧ください。
このプロジェクトは Contributor Covenant に基づく行動規範を採用しています。
ライセンス
関連リンク
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mrbs-0.1.0.tar.gz.
File metadata
- Download URL: mrbs-0.1.0.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf94b69024bee065e86da916d1d809fe8727a1040891c537ff28a352a1a0056c
|
|
| MD5 |
8ea3df6a1474620e50191961728aa7f3
|
|
| BLAKE2b-256 |
331025b2804eb3fc307073bf530578785e2f7f1b594ee7f163d6318f96348a75
|
Provenance
The following attestation bundles were made for mrbs-0.1.0.tar.gz:
Publisher:
publish.yml on yut0takagi/MRBS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrbs-0.1.0.tar.gz -
Subject digest:
cf94b69024bee065e86da916d1d809fe8727a1040891c537ff28a352a1a0056c - Sigstore transparency entry: 739717625
- Sigstore integration time:
-
Permalink:
yut0takagi/MRBS@0728b741323bb1f23671f22c3cf41db948872189 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yut0takagi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0728b741323bb1f23671f22c3cf41db948872189 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mrbs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mrbs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3f0b8a317995c22fc2668b4fef6a28eb7c6dea27f94bb8eee5106b6f0eff9a3
|
|
| MD5 |
8e7423153daa53911b8f1906bd47077f
|
|
| BLAKE2b-256 |
86e7dffbbe56a5432ea4819266217c89194c5297f034d565b153632a2e9cd65b
|
Provenance
The following attestation bundles were made for mrbs-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yut0takagi/MRBS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrbs-0.1.0-py3-none-any.whl -
Subject digest:
f3f0b8a317995c22fc2668b4fef6a28eb7c6dea27f94bb8eee5106b6f0eff9a3 - Sigstore transparency entry: 739717633
- Sigstore integration time:
-
Permalink:
yut0takagi/MRBS@0728b741323bb1f23671f22c3cf41db948872189 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yut0takagi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0728b741323bb1f23671f22c3cf41db948872189 -
Trigger Event:
push
-
Statement type: