Tabular Regression
Scikit-learn
Joblib
Spanish
machine-learning
regression
linear-regression
educational-example
Instructions to use WalterWi/Sklearn_regresion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use WalterWi/Sklearn_regresion with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("WalterWi/Sklearn_regresion", "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: 583 Bytes
017ff20 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """Carga model.joblib y predice el precio de casas nuevas. No vuelve a entrenar.
Uso:
python predict.py
"""
from pathlib import Path
import joblib
import pandas as pd
CARPETA = Path(__file__).parent
modelo = joblib.load(CARPETA / "model.joblib")
# Las columnas tienen que llamarse igual que en el entrenamiento
casas_nuevas = pd.DataFrame(
{"m2": [50, 80, 110], "balcon": [0, 1, 1], "ascensor": [0, 0, 1]}
)
for casa, precio in zip(casas_nuevas.to_dict("records"), modelo.predict(casas_nuevas)):
print(f"{casa} -> {precio:.1f} miles de US$")
|