Downloads · 30 days
0
ash001/nyc-taxi-fare-regression-ann
nyc-taxi-fare-regression-ann is a tabular regression model from ash001. Use it for the tabular regression task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
A small PyTorch tabular regression model that predicts NYC taxi fare (USD) from trip time + pickup/dropoff coordinates + passenger count.
Downloads · 30 days
0
Access
Public
Updated Mar 2, 2026
Repo size
113 KB
Likes
0
Public
Click a slice to open those files.
.csv9.4 MB · 99%
From the Hugging Face model README
A small PyTorch tabular regression model that predicts NYC taxi fare (USD) from trip time + pickup/dropoff coordinates + passenger count.
This Hugging Face repo stores the trained model weights + preprocessing schema used by a Streamlit inference app.
pages/02_NYC_Taxi_Fare_Regression.py)artifacts/model_state.pt — PyTorch model state dict (ANN with embeddings)artifacts/schema.json — feature schema, category lists, embedding sizes, cont mean/stdartifacts/metrics.json — validation metrics (RMSE/MAE)artifacts/sample_rows.csv — small sample used by the Streamlit UI “load a row”NYCTaxiFares.csv — dataset file used in trainingThe model uses: Categorical (embedded)
Hour (0–23)AMorPM (am / pm)Weekday (Mon…Sun)Continuous
pickup_latitude, pickup_longitudedropoff_latitude, dropoff_longitudepassenger_count (1–6)dist_km (computed using haversine distance)dist_km is computed from pickup/dropoff lat/lon using the haversine formula.cont_mean / cont_std stored in schema.json.schema.json (cat_categories).Training notes (from notebook):
Hour / AMorPM / Weekday were derived from pickup_datetime after a ~4 hour timezone shift (stored as timezone_shift_hours=4 in schema.json).A single float: predicted taxi fare (USD).
From artifacts/metrics.json (validation split):
import json
import torch
import numpy as np
from huggingface_hub import hf_hub_download
REPO_ID = "ash001/nyc-taxi-fare-regression-ann"
schema_path = hf_hub_download(REPO_ID, "artifacts/schema.json")
state_path = hf_hub_download(REPO_ID, "artifacts/model_state.pt")
with open(schema_path, "r", encoding="utf-8") as f:
schema = json.load(f)
cat_cols = schema["cat_cols"]
cont_cols = schema["cont_cols"]
cat_categories = schema["cat_categories"]
cont_mean = np.array(schema["cont_mean"], dtype=np.float32)
cont_std = np.array(schema["cont_std"], dtype=np.float32)
# Define the same model class used in your inference app, then:
# model.load_state_dict(torch.load(state_path, map_location="cpu"))
# model.eval()
For an end-to-end prediction example (feature building + distance + standardization), see the Streamlit inference implementation in your app.