Modelos Soportados
godml incluye una librería de modelos listos para usar. Configura el tipo con model.type en el YAML.
Resumen
model.type | Algoritmo | Tarea | MLflow | SageMaker |
|---|---|---|---|---|
xgboost | XGBoost | Clasificación / Regresión | ✅ | ✅ |
random_forest | RandomForest | Clasificación / Regresión | ✅ | ✅ |
logistic_regression | Logistic Regression | Clasificación | ✅ | ✅ |
lightgbm | LightGBM | Clasificación / Regresión | ✅ | ✅ |
lstm | LSTM (Keras) | Series de tiempo | ✅ | ❌ |
linear_regression | Linear Regression | Regresión | ✅ | ❌ |
XGBoost
model:
type: xgboost
hyperparameters:
max_depth: 6
eta: 0.3 # learning rate
n_estimators: 200
objective: binary:logistic # o reg:squarederror para regresión
random_state: 42
Random Forest
model:
type: random_forest
hyperparameters:
n_estimators: 100
max_depth: 10 # null = sin límite
max_features: sqrt # sqrt | log2 | null
random_state: 42
Logistic Regression
model:
type: logistic_regression
hyperparameters:
random_state: 42
# max_iter: 1000 — configurado internamente
LightGBM
model:
type: lightgbm
hyperparameters:
n_estimators: 200
max_depth: -1 # -1 = sin límite
random_state: 42
Requiere:
pip install godml[advisor] # incluye lightgbm
LSTM (Series de tiempo)
model:
type: lstm
hyperparameters:
eta: 0.001 # learning rate
n_estimators: 50 # epochs
random_state: 42
Requiere:
pip install godml[deep] # incluye TensorFlow + Keras
AutoTuner
godml ajusta hiperparámetros automáticamente según el dataset antes de entrenar:
model:
type: xgboost
hyperparameters:
max_depth: 6 # punto de partida — el AutoTuner puede ajustarlo
Reglas del AutoTuner:
- Dataset desbalanceado: ajusta
scale_pos_weightautomáticamente - Dataset pequeño (<500 filas): reduce
n_estimatorspara evitar overfitting - Multiclase detectada: cambia
objectiveamulti:softmax
Modelo personalizado
Puedes usar tu propio modelo implementando BaseModel:
mi_modelo.py
from godml.model_service.base_model_interface import BaseModelInterface
class MiModelo(BaseModelInterface):
def train(self, X_train, y_train, X_test, y_test, params):
# tu lógica aquí
model = ...
predictions = ...
return model, predictions
model:
type: mi_modelo
source: local # busca en el proyecto actual
Métricas calculadas automáticamente
Para clasificación binaria:
auc— Area Under ROC Curveaccuracy— Exactitudf1— F1-Scoreprecision— Precisiónrecall— Exhaustividad