Ameer Hamza Nasir — Data & ML Engineer
Machine Learning · Computer Vision · FastAPI · Open Source
// The Builder
// Project 01
Real-time adaptive traffic signal for a 4-way chowk intersection. Pakistan's standard fixed 120s timer wastes green time on empty roads. YOLOv5 detects vehicles per lane. A Greedy scheduler allocates green time based on live congestion — cars queue at the stop line on red and release when it's their turn.
// What I Learned
Impact: Simulated a 31% reduction in average wait time. The greedy scheduler proved more effective than fixed-timer systems, but required careful tuning of the max-heap to avoid starvation on low-traffic lanes.
// Project 02
End-to-end pipeline on 284,807 credit card transactions. SMOTE oversampling for class imbalance. XGBoost with stratified k-fold cross-validation. Deployed as FastAPI REST endpoint on AWS EC2.
// What I Learned
Tradeoff: SMOTE outperformed class-weighting, but generated synthetic samples that occasionally overlapped with legitimate patterns. We resolved this by applying a stricter threshold (0.6) for fraud classification, increasing precision without sacrificing recall.
// Project 03
CNN built in PyTorch on MNIST — 60,000 training images, 99.1% test accuracy. Draw a digit below.
// What I Learned
Optimization: Initial accuracy was ~97% due to poor preprocessing. Adding center-of-mass centering and normalizing stroke width pushed the model to 99.1%. The biggest lesson: data preprocessing often matters more than architecture tweaks.
// Open Source
Dockerized proxy eliminating Anthropic billing. Routes Claude Code API through OpenRouter free-tier LLMs. Node.js reverse proxy with real-time format translation and SSE streaming.
// What I Learned
Real-world impact: The SSE format translation was tricky — Claude Code expects a specific event stream, and OpenRouter returns a different structure. Solving this with a transform stream taught me the value of robust error handling in middleware.
// Code
# greedy green-time allocator
import heapq
def allocate_green_time(lanes):
# max-heap by congestion
pq = [(-l['score'], l['id']) for l in lanes]
heapq.heapify(pq)
while pq:
score, lane_id = heapq.heappop(pq)
set_green(lane_id, duration=-score * 2)
# fraud detection pipeline
from xgboost import XGBClassifier
from imblearn.over_sampling import SMOTE
smote = SMOTE(random_state=42)
X_res, y_res = smote.fit_resample(X_train, y_train)
model = XGBClassifier(
n_estimators=300,
max_depth=6,
learning_rate=0.1
)
model.fit(X_res, y_res)
# f1: 0.91 | auc: 0.98
# mnist cnn in pytorch
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(1, 32, 3)
self.conv2 = nn.Conv2d(32, 64, 3)
self.fc1 = nn.Linear(64*5*5, 128)
self.fc2 = nn.Linear(128, 10)
def forward(self, x):
x = F.relu(F.max_pool2d(
self.conv1(x), 2))
return x
// claudecode proxy - node.js
const http = require('http');
const proxy = http.createServer((req, res) => {
const body = translateFormat(req);
forwardToOpenRouter(body)
.then(data => res.end(data))
.catch(err => res.statusCode=500);
});
proxy.listen(8080, () => {
console.log('Proxy Online');
});
// Contact
Open to data analytics internships, ML engineering roles, and freelance projects. I respond fast.
hamza6700@gmail.com