Downloads · 30 days
0
spacevillaAfrica/property-price-tfidf-ridge
property-price-tfidf-ridge is a machine learning model from spacevillaAfrica. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a baseline regression model that predicts Nigerian property prices (₦) from text descriptions and metadata.
Downloads · 30 days
0
Access
Public
Updated Nov 19, 2025
Repo size
138 KB
Likes
0
Public
Click a slice to open those files.
.pkl138 KB · 98%
From the Hugging Face model README
This is a baseline regression model that predicts Nigerian property prices (₦) from text descriptions and metadata.
TfidfVectorizer + Ridge regression (scikit-learn pipeline)costAmount in Naira from a combined prompt describing the property.The model was trained on text prompts that include:
Targets are prices in Naira (costAmount).
Metrics were computed on both train and test using:
These errors are large in absolute terms because the model mixes very different price scales (short-let daily vs high-value sale) in one regression. It is intended as a baseline, not a production model.
Install dependencies:
pip install -U scikit-learn huggingface_hub
from huggingface_hub import hf_hub_download
import joblib
REPO_ID = "spacevillaAfrica/property-price-tfidf-ridge"
FILENAME = "baseline_tfidf_ridge.pkl"
model_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
model = joblib.load(model_path)
prompt = """Based on the details below, what is the most likely price (costAmount) in Naira?
Luxury 1 Bedroom Apartment
Features: 24/7 power, pool, gym, WiFi, security
Location: Lekki Phase 1, Lekki, Lagos, Nigeria
Listing Type: shortlet
Frequency: daily
"""
pred = model.predict([prompt])[0]
print(f"Predicted price: ₦{pred:,.0f}")