Abolfazl Ranjbaran
ML that ships, with numbers that survive review.
Nine end-to-end projects — from a Persian retrieval-augmented assistant with hybrid search and streaming, to a GPT whose autograd engine is written in raw NumPy. Every headline number is reproducible from committed code, seeds and golden sets.
Try it right here
The two flagship models run as public Hugging Face Spaces, embedded below — no signup, nothing to install. First load can take a minute: free-tier Spaces sleep and cold-start on demand.
Free Hugging Face Spaces sleep and restart on demand — usually ready in a minute. If this takes long, open the Space's page to wake it up; the embed switches on automatically as soon as the Space is running.
checking the Space…Free Hugging Face Spaces sleep and restart on demand — usually ready in a minute. If this takes long, open the Space's page to wake it up; the embed switches on automatically as soon as the Space is running.
checking the Space…Persian RAG assistant
Hybrid BM25 + dense retrieval with RRF fusion, re-ranking, prompt-injection guardrails and a paraphrase-aware answer cache — answering Persian questions with cited sources.
GPT, trained from scratch — in your browser
The unchanged raw-NumPy stack runs in-browser via Pyodide/WASM: a 249k-parameter char-level transformer generating Persian text, no server involved.
REST API, captured session
A real Swagger UI from a committed OpenAPI snapshot plus verbatim captured responses: health, spam scoring, a cited RAG answer with per-stage timings, an SSE stream and Prometheus output.
Projects
Every project ships as a structured codebase (src/ + tests/), a README with methodology and evaluation numbers that can be re-run — including the unflattering ones.
Persian RAG assistant rag-farsi-assistant
E5 embeddings + FAISS fused with a from-scratch BM25 via Reciprocal Rank Fusion; bilingual query expansion, exact + semantic answer cache, per-stage traces, RAGAS-style evaluation, Ollama/OpenAI providers and a Streamlit chat UI.
TinyGPT tiny-gpt-from-scratch
A reverse-mode autograd engine, decoder-only transformer and Adam — all in raw NumPy, no PyTorch/JAX. Every primitive is verified against numerical gradients; Persian char-level training.
AI-text detector ai-text-detector
TF-IDF plus stylometric features (sentence-length variation, punctuation habits) with Linear SVM vs Naive Bayes vs Logistic Regression; every number reproduced in a real retraining run.
Recommender system recommender-system
User-based and item-based collaborative filtering plus matrix factorization (ALS + truncated SVD) — all implemented from scratch on MovieLens.
Stock movement ML stock-movement-ml
20 technical indicators, walk-forward validation and a leakage-free backtest with costs — with a Plotly dashboard. The honest number stays published on purpose.
SMS spam classifier sms-spam
TF-IDF (1–2 grams) + Logistic Regression with 5-fold GridSearchCV — the disciplined baseline the bigger projects are measured against.
One FastAPI layer over all model families serving/
A single serving contract for RAG, spam and stock families: one OpenAPI schema, SSE streaming, per-stage Prometheus metrics, Docker Compose stack for local runs — plus a deployable HF Space with the index and E5 cache pre-baked at build time.
Get started in three commands
No GPU, no API keys, no model downloads needed for the unit tests — the CI runs network-free by design, and so can you.
Clone
The whole portfolio is one repository with a shared Makefile.
git clone https://github.com/Abolfazlrwm/Machine-Learning.git
cd Machine-LearningRun the tests
Every project's suite in one target — RAG, serving, TinyGPT, recsys, NLP projects.
pip install numpy requests pytest pypdf
make testServe it
The FastAPI layer exposes all model families on one contract, with Swagger at /docs.
pip install -r serving/requirements.txt
make api # http://127.0.0.1:8000/docsFull stack (API + Ollama + Streamlit chat +
Prometheus + Grafana): docker compose up — see the
deployment guide.
How a query flows
The serving pipeline in one strip — every stage emits timings that land in Prometheus.
Engineering decisions
The load-bearing choices are written down in Engineering Decision Records — context, decision, consequences, with verified numbers only.
What you can do with it
Point the serving layer at your own corpus, keep the retrieval, guardrails, caching and metrics stack, and deploy with the included Docker Compose or the pre-baked HF Space image.
TinyGPT's autograd engine and the from-scratch BM25/ALS implementations are deliberately readable and gradient-check-tested — a worked reference, not a black box.
Network-free CI, contract tests for model artifacts, tag-gated releases with changelog-extracted notes, ADRs: copy the patterns into your own project regardless of stack.
FAQ
Do I need a GPU, API keys or model downloads to run this?
serving/.env.example.Why is the stock predictor's ROC-AUC only 0.53? Isn't that bad?
What exactly is a "fake embedder" and why would you test with one?
Is the content Persian-only?
How do I cite this work?
CITATION.cff; GitHub renders it under "Cite this
repository". Current version:
see the releases.