Instructions to use bolewara/books-price-predictor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use bolewara/books-price-predictor with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("bolewara/books-price-predictor", "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
Books to Scrape Price Predictor
Random Forest regressor that predicts the price of a book (in GBP) from a scraped books catalog (1000 books from books.toscrape.com).
Model Characteristics
- Type: Regression (RandomForestRegressor, 300 trees)
- Inputs: star rating (1-5), title length, title word count, presence of ':', + 8 title TF-IDF topics via TruncatedSVD
- Output: predicted price in GBP
- CV MAE: 13.3 GBP (+/- 0.33) on 5-fold cross-validation
Data Overview
- Dataset:
books-to-scrape-catalog-dataset(1000 rows) - Raw HTML-wrapped prices cleaned via regex; word ratings (One-Five) mapped to integers
Evaluation Results
- 5-fold CV Mean Absolute Error: 13.3 GBP
- Baseline (predict median): 12.5 GBP
- Title-only features give weak signal; adding category/genre would improve accuracy
Files
model.joblibโ trained RandomForestRegressortfidf.joblibโ fitted TfidfVectorizersvd.joblibโ fitted TruncatedSVDnumeric_feats.joblibโ list of numeric feature namesfeature_names.npyโ full feature names
Usage
import joblib
model = joblib.load("model.joblib")
Provenance
Trained by Anuj Bolewar (anujbolewar on Kaggle) on the books-to-scrape catalog dataset.
- Downloads last month
- -