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
Download exportar.py from amandaodoo/casas-sklearn-exportar-pickle: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/amandaodoo/casas-sklearn-exportar-pickle/resolve/main/exportar.py
- Command line
-
hf download hf://amandaodoo/casas-sklearn-exportar-pickle/exportar.py
-
curl -L -o exportar.py https://huggingface.co/amandaodoo/casas-sklearn-exportar-pickle/resolve/main/exportar.py
557 Bytes
| """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") | |