このプロジェクトについて
Mlxtend(machine learning extensions)は、日々のデータサイエンス作業に役立つツールを集めたPythonライブラリです。主に以下の用途で使用されます:
- スタッキングや投票分類器などのアンサンブル手法
- 特徴量選択および特徴量抽出の手法
- 可視化ユーティリティ(例:決定領域、混同行列)
- モデル分析のためのプロットヘルパー
- アソシエーションルールマイニングのためのAprioriアルゴリズムを含む頻出パターンマイニング
Sebastian Raschka 2014-2026
## リンク
- **ドキュメント:** [https://rasbt.github.io/mlxtend](https://rasbt.github.io/mlxtend)
- PyPI: [https://pypi.python.org/pypi/mlxtend](https://pypi.python.org/pypi/mlxtend)
- Changelog: [https://rasbt.github.io/mlxtend/CHANGELOG](https://rasbt.github.io/mlxtend/CHANGELOG)
- Contributing: [https://rasbt.github.io/mlxtend/CONTRIBUTING](https://rasbt.github.io/mlxtend/CONTRIBUTING)
- 質問がありますか?[GitHub Discussions board](https://github.com/rasbt/mlxtend/discussions)をご覧ください
## mlxtendのインストール
#### uvを使用する場合
uvで管理されているプロジェクトにmlxtendを追加するには、次を実行します
```bash
uv add mlxtend
```
現在のプロジェクトを変更せずに一度だけコマンドを実行する場合は、次を実行します
```bash
uv run --with mlxtend python -c "import mlxtend; print(mlxtend.__version__)"
```
#### 開発版
PyPI上のmlxtendのバージョンは常に一歩遅れている可能性があります。GitHubリポジトリから最新の開発版をインストールするには、次を実行します
```bash
uv add "mlxtend @ git+https://github.com/rasbt/mlxtend.git"
```
または、https://github.com/rasbt/mlxtend からGitHubリポジトリをフォークし、ローカルのチェックアウトからmlxtendを実行できます
```bash
git clone https://github.com/<your_username>/mlxtend.git
cd mlxtend
uv sync --group dev
uv run python -c "import mlxtend; print(mlxtend.__version__)"
```
## 例
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import itertools
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from mlxtend.classifier import EnsembleVoteClassifier
from mlxtend.data import iris_data
from mlxtend.plotting import plot_decision_regions
# Initializing Classifiers
clf1 = LogisticRegression(random_state=0)
clf2 = RandomForestClassifier(random_state=0)
clf3 = SVC(random_state=0, probability=True)
eclf = EnsembleVoteClassifier(clfs=[clf1, clf2, clf3], weights=[2, 1, 1], voting='soft')
# Loading some example data
X, y = iris_data()
X = X[:,[0, 2]]
# Plotting Decision Regions
gs = gridspec.GridSpec(2, 2)
fig = plt.figure(figsize=(10, 8))
for clf, lab, grd in zip([clf1, clf2, clf3, eclf],
['Logistic Regression', 'Random Forest', 'RBF kernel SVM', 'Ensemble'],
itertools.product([0, 1], repeat=2)):
clf.fit(X, y)
ax = plt.subplot(gs[grd[0], grd[1]])
fig = plot_decision_regions(X=X, y=y, clf=clf, legend=2)
plt.title(lab)
plt.show()
```
科学論文のワークフローの一部としてmlxtendを使用する場合は、以下のDOIでmlxtendリポジトリを引用することをご検討ください:
```
@article{raschkas_2018_mlxtend,
author = {Sebastian Raschka},
title = {MLxtend: Providing machine learning and data science
utilities and extensions to Python’s
scientific computing stack},
journal = {The Journal of Open Source Software},
volume = {3},
number = {24},
month = apr,
year = 2018,
publisher = {The Open Journal},
doi = {10.21105/joss.00638},
url = {https://joss.theoj.org/papers/10.21105/joss.00638}
}
```
- Raschka, Sebastian (2018) MLxtend: Providing machine learning and data science utilities and extensions to Python's scientific computing stack.
J Open Source Softw 3(24).
## ライセンス
- このプロジェクトは、寛容な新しいBSDオープンソースライセンス([LICENSE-BSD3.txt](https://github.com/rasbt/mlxtend/blob/master/LICENSE-BSD3.txt))の下で公開されており、商用利用可能です。保証はありません。商品性や特定目的への適合性についても保証されません。
- さらに、このディストリビューションに含まれるすべての芸術的創作物(図や画像)は、
Creative Commons Attribution 4.0 International Licenseの条項および条件に従って、使用、複製、変更、再配布することができます。詳細は[LICENSE-CC-BY.txt](https://github.com/rasbt/mlxtend/blob/master/LICENSE-CC-BY.txt)ファイルをご覧ください。(matplotlibによって生成されたプロットなどのコンピュータ生成グラフィックスは、上記のBSDライセンスに該当します)。
## お問い合わせ
質問をする最良の方法は、[GitHub Discussionsチャンネル](https://github.com/rasbt/mlxtend/discussions)を通じてです。使用上のバグに遭遇した場合は、遠慮なく[GitHubのissue tracker](https://github.com/rasbt/mlxtend/issues)を直接ご利用ください。
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.