Busabase
Busabase는 AI 에이전트를 위한 오픈소스(MIT) 데이터베이스 및 작업 공간입니다
뉴욕 택시 소요시간을 알려주는, 721K 정제 데이터와 LightGBM 모델 기반 브라우저 예측기
How long does a New York taxi ride take? 721K cleaned 2016 trips, a LightGBM model tested on unseen June trips, and a predictor that runs in your browser.
데이터Jupyter Notebook · PythonGitHub @neilss170온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
How long will a NYC taxi ride take? LightGBM tested on an unseen month (RMSLE 0.320), with a live dashboard and a trip predictor that runs in your browser.
README 전체를 불러오는 중입니다.
README 전문 보기 ↗How long will a New York yellow-cab ride take? This project cleans 729,322 trips from January to June 2016, trains a LightGBM model that is tested on a month it never saw, and ships that exact model to a dashboard where it runs in the browser.
Live dashboard: https://neilss170.github.io/nyc-taxi-trip-duration/ (overview, a street map of the trips, an in-browser trip predictor, model results and data quality; plain HTML, SVG, Canvas and Leaflet)
The model is trained on January to May and scored on every June trip (116,042 after cleaning), so it is
judged on a month it has never seen. The target is log1p(seconds), so the score is RMSLE, the metric of the
original Kaggle competition. All numbers come from reports/pipeline_metrics.json.
| Model (25 features, same June test set) | Test RMSLE | Median miss | Mean miss | R² (log) |
|---|---|---|---|---|
| LightGBM | 0.320 | 1.74 min | 3.15 min | 0.814 |
| HistGradientBoosting | 0.322 | 1.77 min | 3.19 min | 0.812 |
| Ridge regression | 0.452 | 3.06 min | 4.74 min | 0.631 |
| Baseline (training mean) | 0.746 | 5.21 min | 8.05 min | 0.000 |
notebooks/model.ipynb, the pipeline
scores 0.288 against the notebook's 0.390 (the cleaning differs, so this is not a perfectly equal comparison).The Predict tab runs the trained model with no server. python -m tripdur train exports the LightGBM trees and
the fitted feature state (location clusters, target encodings) to site/model/model.json, and
site/predict.js re-implements every feature in JavaScript. Every feature is something a
rider knows before the trip: two points, a pickup time, passengers and vendor.
The tests hold the two languages equal: on 300 June trips the Node-computed features match Python to 1e-12 and the predictions to 1e-9. Next to each prediction the page shows the median of similar past trips (same pickup and drop-off area, same time of day) and the June error for trips of that length.
data/nyc_taxi_trip_duration.csv 729,322 trips, Jan-Jun 2016
→ clean (6 rules) 721,117 kept; 8,205 removed, counted per rule
→ split by time train Jan-May (605,075) | test June (116,042)
→ features (fit on training rows only) grid and straight-line distance, bearing, time, airports, holidays,
out-of-fold smoothed encodings of 40 location clusters
→ models mean baseline, Ridge, HistGradientBoosting, LightGBM
(rounds by early stopping on the last two weeks of May)
→ export site/model/model.json, reports/pipeline_metrics.json, site/data/*.json
Cleaning removes trips under 1 minute (4,271) or over 3 hours (1,031), trips that never move (4,295), pickups or drop-offs outside New York City (583), straight-line speeds over 100 km/h (86) and 0 or 7+ passengers (35); a trip can break more than one rule.
Python 3.11. The full trip file is not in the repository (98 MB); save it as data/nyc_taxi_trip_duration.csv
with the same columns as the included sample, data/nyc_taxi_sample.csv.
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
$env:PYTHONPATH = "src"
python -m tripdur train # clean, split, features, models, export (about 1 minute)
python -m tripdur site # dashboard extracts in site/data
python -m pytest # 12 tests, including the Python/JavaScript parity check (needs Node)
python -m http.server -d site # the dashboard at http://localhost:8000
The tests need only the committed model and fixture, not the full data, and run in CI on every push.
The notebooks are the exploratory history of the project: eda.ipynb, then feature_engineering.ipynb
(writes a random 80/20 split to outputs/), then model.ipynb, which compares five regressors on it and saves
reports/model_metrics.json (best: HistGradientBoosting, RMSLE 0.390). The
pipeline above replaced that approach with a time-based test and features the browser can compute.
The original filterable Streamlit dashboard still runs on the 25,000-row sample after cloning:
python -m streamlit run dashboard\app.py
src/tripdur/ pipeline: config, cleaning, features, training, model export, dashboard extracts
site/ static dashboard (GitHub Pages): index.html, predict.js, model/, data/
tests/ cleaning, features (no target leakage), export and Python/JavaScript parity
notebooks/ EDA, feature engineering and the notebook model comparison
dashboard/ Streamlit app on the included sample
reports/ pipeline and notebook metrics, written reports
docs/ README screenshots