Skip to main content

A Machine Learning Framework for Python inspired by mlr3

Project description

🚀 MLPY - Modern Machine Learning Framework for Python

Python 3.8+ License: MIT Tests Coverage Documentation

MLPY es un framework moderno y extensible de aprendizaje automático para Python, inspirado en mlr3. Proporciona una interfaz unificada, componible y orientada a objetos para tareas de machine learning.

✨ Características Principales

  • 🎯 API Unificada: Interfaz consistente para clasificación, regresión, clustering y más
  • 🧩 Diseño Modular: Bloques componibles para flujos de trabajo complejos
  • 🔧 Altamente Extensible: Fácil integración de nuevos learners, medidas y transformaciones
  • 📊 Evaluación Robusta: Múltiples estrategias de resampling y medidas de rendimiento
  • 🤖 AutoML Integrado: Optimización automática de hiperparámetros y feature engineering
  • Alto Rendimiento: Paralelización nativa y backends optimizados
  • 🔍 Explicabilidad: Interpretación de modelos con SHAP, LIME y más
  • 📈 Visualización Rica: Gráficos interactivos para análisis de resultados
  • 🔗 Integración Total: Compatible con scikit-learn, XGBoost, LightGBM, PyTorch

📦 Instalación

Instalación Básica

pip install mlpy

Instalación Completa (todas las dependencias)

pip install mlpy[all]

Instalación para Desarrollo

git clone https://github.com/your-org/mlpy.git
cd mlpy
pip install -e .[dev]

🚀 Inicio Rápido

Ejemplo Básico de Clasificación

import pandas as pd
from mlpy.tasks import TaskClassif
from mlpy.learners.sklearn import LearnerRandomForestClassifier
from mlpy.resamplings import ResamplingCV
from mlpy.measures import MeasureClassifAccuracy

# Cargar datos
data = pd.read_csv("iris.csv")

# Crear tarea de clasificación
task = TaskClassif(data=data, target="species")

# Crear learner
learner = LearnerRandomForestClassifier(n_estimators=100, random_state=42)

# Configurar cross-validation
cv = ResamplingCV(folds=5)

# Entrenar y evaluar
learner.train(task)
predictions = learner.predict(task)

# Medir rendimiento
measure = MeasureClassifAccuracy()
accuracy = measure.score(predictions.truth, predictions.response)
print(f"Accuracy: {accuracy:.2%}")

Pipeline Completo con AutoML

from mlpy.automl import AutoML
from mlpy.tasks import TaskRegr

# Crear tarea
task = TaskRegr(data=data, target="price")

# Configurar AutoML
automl = AutoML(
    task=task,
    time_budget=300,  # 5 minutos
    metric="rmse"
)

# Ejecutar optimización
best_model = automl.fit()

# Hacer predicciones
predictions = best_model.predict(task)

📚 Documentación Completa

Guías Principales

Casos de Uso

🏗️ Arquitectura

mlpy/
├── core/           # Componentes fundamentales
├── tasks/          # Definición de tareas ML
├── learners/       # Algoritmos de aprendizaje
├── measures/       # Métricas de evaluación
├── resamplings/    # Estrategias de validación
├── pipelines/      # Pipelines de procesamiento
├── automl/         # AutoML y optimización
├── validation/     # Validación de datos
├── backends/       # Backends de computación
└── visualization/  # Herramientas de visualización

🎯 Modelos Disponibles

Clasificación

  • Random Forest, Gradient Boosting, XGBoost, LightGBM
  • SVM, Logistic Regression, Naive Bayes
  • Redes Neuronales (MLP, CNN, RNN)
  • Deep Learning con PyTorch

Regresión

  • Linear/Ridge/Lasso/ElasticNet
  • Random Forest, Gradient Boosting
  • Support Vector Regression
  • Redes Neuronales

Clustering

  • K-Means, DBSCAN, Hierarchical
  • Gaussian Mixture Models
  • Spectral Clustering
  • HDBSCAN con auto-tuning

Deep Learning

  • LSTM, GRU, BiLSTM para series temporales
  • Transformers para NLP
  • CNNs para visión por computadora

📊 Benchmarking

from mlpy.benchmark import Benchmark

# Configurar benchmark
benchmark = Benchmark(
    tasks=[task1, task2],
    learners=[learner1, learner2, learner3],
    resamplings=[cv, holdout],
    measures=[accuracy, auc, f1]
)

# Ejecutar
results = benchmark.run(parallel=True)

# Visualizar
results.plot_comparison()
results.to_latex("results.tex")

🧪 Testing

El framework incluye una suite completa de tests:

# Ejecutar todos los tests
pytest tests/

# Con coverage
pytest --cov=mlpy tests/

# Tests rápidos de validación
python test_quick_validation.py

Estado actual:

  • ✅ 7/7 tests de validación pasando
  • ✅ 29/34 tests unitarios pasando (85%)
  • 📊 16.28% coverage de código

🤝 Contribuir

¡Las contribuciones son bienvenidas! Por favor:

  1. Fork el repositorio
  2. Crea una rama para tu feature (git checkout -b feature/AmazingFeature)
  3. Commit tus cambios (git commit -m 'Add AmazingFeature')
  4. Push a la rama (git push origin feature/AmazingFeature)
  5. Abre un Pull Request

📈 Roadmap

v2.1 (Actual)

  • ✅ Model Registry completo
  • ✅ Deep Learning models (LSTM, GRU, Transformers)
  • ✅ Advanced clustering con auto-tuning
  • ✅ Sistema de validación mejorado

v3.0 (Próximo)

  • MLOps completo (tracking, deployment)
  • AutoML mejorado con NAS
  • Distributed training
  • GUI interactiva

📝 Licencia

Este proyecto está licenciado bajo la Licencia MIT - ver el archivo LICENSE para más detalles.

🙏 Agradecimientos

  • Inspirado en mlr3 de R
  • Construido sobre scikit-learn
  • Integración con el ecosistema Python ML

📞 Contacto


⭐ Si te gusta MLPY, dale una estrella en GitHub!

Hecho con ❤️ por la comunidad MLPY

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlpy_geo-0.1.0.tar.gz (508.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlpy_geo-0.1.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file mlpy_geo-0.1.0.tar.gz.

File metadata

  • Download URL: mlpy_geo-0.1.0.tar.gz
  • Upload date:
  • Size: 508.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for mlpy_geo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e50422e971cc3504fa8fe0c6cddccd06710adbae37efb03406035430e740f333
MD5 c626a563b9e328f27f53defbb7532b11
BLAKE2b-256 2eab4710e34cdc97bcb717f8a1f395485ab8be122186fafff3236927be293d61

See more details on using hashes here.

File details

Details for the file mlpy_geo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mlpy_geo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for mlpy_geo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6049e87890107d167eae0bc7459edfc8c4593193815677e91452477011e8bb9
MD5 be14d29ac2c9ae8b888e0fc0565e1bfb
BLAKE2b-256 f7d4b9dde5341d0beb6724389b0baa880fefa055b7c3211c170fde2ec1129be5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page