Sobre o projeto
Mlxtend (machine learning extensions) é uma biblioteca Python de ferramentas úteis para as tarefas diárias de ciência de dados. É usada principalmente para:
- Métodos de ensemble, como classificadores de stacking e voting
- Técnicas de seleção e extração de atributos
- Utilitários de visualização (por exemplo, regiões de decisão, matrizes de confusão)
- Auxiliares de plotagem para análise de modelos
- Mineração de padrões frequentes, incluindo o algoritmo Apriori para mineração de regras de associação
Sebastian Raschka 2014-2026
## Links
- **Documentação:** [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)
- Dúvidas? Confira o [GitHub Discussions board](https://github.com/rasbt/mlxtend/discussions)
## Instalando o mlxtend
#### Usando uv
Para adicionar o mlxtend a um projeto gerenciado pelo uv, execute
```bash
uv add mlxtend
```
Para um comando pontual sem alterar seu projeto atual, execute
```bash
uv run --with mlxtend python -c "import mlxtend; print(mlxtend.__version__)"
```
#### Versão de desenvolvimento
A versão do mlxtend no PyPI pode sempre estar um passo atrás; você pode instalar a versão de desenvolvimento mais recente a partir do repositório do GitHub executando
```bash
uv add "mlxtend @ git+https://github.com/rasbt/mlxtend.git"
```
Ou você pode fazer um fork do repositório do GitHub em https://github.com/rasbt/mlxtend e executar o mlxtend a partir do seu checkout local via
```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__)"
```
## Exemplos
```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()
```
Se você usar o mlxtend como parte do seu fluxo de trabalho em uma publicação científica, considere citar o repositório do mlxtend com o seguinte DOI:
```
@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).
## Licença
- Este projeto é distribuído sob uma licença de código aberto BSD nova e permissiva ([LICENSE-BSD3.txt](https://github.com/rasbt/mlxtend/blob/master/LICENSE-BSD3.txt)) e pode ser usado comercialmente. Não há garantia; nem mesmo de comerciabilidade ou adequação a um propósito específico.
- Além disso, você pode usar, copiar, modificar e redistribuir todas as obras artísticas criativas (figuras e imagens) incluídas nesta distribuição sob o diretório
conforme os termos e condições da Licença Internacional Creative Commons Attribution 4.0. Consulte o arquivo [LICENSE-CC-BY.txt](https://github.com/rasbt/mlxtend/blob/master/LICENSE-CC-BY.txt) para detalhes. (Gráficos gerados por computador, como os gráficos produzidos pelo matplotlib, estão sob a licença BSD mencionada acima).
## Contato
A melhor forma de fazer perguntas é pelo [canal GitHub Discussions](https://github.com/rasbt/mlxtend/discussions). Caso você encontre bugs de uso, não hesite em usar diretamente o [GitHub's issue tracker](https://github.com/rasbt/mlxtend/issues).
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.