Tabular Regression
Scikit-learn
Spanish
machine-learning
regression
linear-regression
educational-example
pickle
Instructions to use amandaodoo/casas-sklearn-exportar-pickle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use amandaodoo/casas-sklearn-exportar-pickle with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("amandaodoo/casas-sklearn-exportar-pickle", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
File size: 557 Bytes
0b1a790 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | """Exporta el modelo de scikit-learn en formato pickle: model.pkl.
No vuelve a entrenar: parte de ../sklearn-entrenamiento-evaluacion/model.joblib
(correr antes ese train.py).
Uso:
python exportar.py
"""
from pathlib import Path
import joblib
import pickle
CARPETA = Path(__file__).parent
modelo = joblib.load(CARPETA.parent / "sklearn-entrenamiento-evaluacion" / "model.joblib")
with open(CARPETA / "model.pkl", "wb") as f:
pickle.dump(modelo, f) # guarda el objeto entero de Python
print("Modelo guardado en model.pkl")
|