Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/aprl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Custom ML algorithm (APRL)

on:
push:
paths:
- "src/aprl/**"
- "tests/**"
- "examples/aprl_quickstart.py"
- "benchmarks/benchmark_aprl.py"
- "pyproject.toml"
- ".github/workflows/aprl.yml"
pull_request:
paths:
- "src/aprl/**"
- "tests/**"
- "examples/aprl_quickstart.py"
- "benchmarks/benchmark_aprl.py"
- "pyproject.toml"
- ".github/workflows/aprl.yml"

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: python -m pip install -e ".[dev]"
- run: python -m ruff check src tests examples/aprl_quickstart.py benchmarks/benchmark_aprl.py
- run: python -m pytest
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ desktop.ini
# Python (if anyone adds tooling)
__pycache__/
*.pyc
*.egg-info/
.pytest_cache/
.ruff_cache/
build/
dist/
.venv/
venv/
.env
Expand Down
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ atlas/TAGS.md — the controlled tag vocabulary (authoritative)
Files are organized **by source on disk**, but tagged **by topic** in
frontmatter — so retrieve by tag/content, not by folder.

## Experimental APRL algorithm

This repository also contains an installable experimental tabular-learning
algorithm, **Adaptive Prototype Residual Learning (APRL)**. It is separate from
the corpus build pipeline:

- `algorithms/aprl/README.md` — mathematical specification, API, and limitations
- `algorithms/aprl/RELATED_WORK.md` — prior art and the novelty boundary
- `algorithms/aprl/BENCHMARKS.md` — generated baseline results
- `src/aprl/` — NumPy implementation
- `tests/` — behavioral tests
- `benchmarks/benchmark_aprl.py` — reproducible comparison runner

Do not describe APRL as scientifically novel or state of the art. It is a custom
experimental composition whose individual ingredients have substantial prior art.
Run `python -m pytest` and Ruff after changing it.

## Frontmatter schema

Every doc starts with a YAML block. Fields you'll use for retrieval:
Expand Down
11 changes: 6 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ MIT License

Copyright (c) 2026 ML Foundations Corpus contributors

The MIT License below applies to the ORGANIZATION of this repository — its
structure, index, and any scripts. It does NOT grant rights to the underlying
educational content (research papers, lecture transcripts, and articles), which
remains the property of its original authors and is included for research and
educational purposes. See NOTICE.md and SOURCES.md.
The MIT License below applies to the ORIGINAL WORK in this repository — its
structure, index, scripts, APRL algorithm implementation, tests, examples, and
documentation. It does NOT grant rights to the underlying educational content
(research papers, lecture transcripts, and articles), which remains the property
of its original authors and is included for research and educational purposes.
See NOTICE.md and SOURCES.md.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This repository is a **curation** of publicly available machine-learning educati
| Component | Rights |
|---|---|
| Repository structure, `INDEX.md`, organization, any scripts | MIT License (this repo) |
| APRL implementation, tests, examples, and documentation | MIT License (this repo) |
| arXiv papers (`corpus/papers/`) | Retained by their authors; included under arXiv's non-exclusive distribution license. Source ID + URL in each file. |
| Lecture transcripts (`corpus/youtube/`) | Auto-generated captions of publicly available videos, included for research/educational use. All rights remain with the speakers, courses, and institutions. |
| Web articles (`corpus/web/`) | Copyright their respective authors/publishers. Included for research/educational use with attribution and source URLs. |
Expand Down
79 changes: 70 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,60 @@
# Machine Learning Library
# Custom Machine Learning Algorithm + Curated ML Knowledge Base

**A hand-curated, machine-readable library (a curated ML corpus / dataset) of the best machine-learning education on the internet — top university courses, canonical research papers, and the most-cited explainer blogs — normalized into one consistent Markdown format with full provenance.**
**One repository with two connected layers: Adaptive Prototype Residual Learning
(APRL), a custom experimental algorithm for numeric tabular ML, and a
hand-curated, machine-readable knowledge base of leading university courses,
canonical research papers, and widely cited explainers—normalized into consistent
Markdown with full provenance.**

923 documents · ~11 million tokens · beginner to frontier (2026) research · every source credited.
Custom classifier + regressor · 923 documents · ~11 million tokens · beginner to
frontier (2026) research · every source credited.

![docs](https://img.shields.io/badge/documents-923-blue)
![tokens](https://img.shields.io/badge/tokens-~11M-green)
![papers](https://img.shields.io/badge/arXiv_papers-391-orange)
![lectures](https://img.shields.io/badge/lectures-474-red)
![articles](https://img.shields.io/badge/articles-58-purple)
![topics](https://img.shields.io/badge/topics-17-blueviolet)
![tests](https://img.shields.io/badge/APRL_tests-11_passing-brightgreen)

> **🆕 Now topic-organized, Obsidian-ready, and agent-ready.** Every doc is tagged into a 17-topic map ([`atlas/`](atlas/)); open the folder as a turnkey **Obsidian vault** (bundled config + graph), or point **Claude Code / Cursor / any agent** at it and it answers ML questions citing real papers and lectures. → [**Open in Obsidian / connect your agent**](#open-in-obsidian--connect-your-agent)
> **🧪 Build with APRL.** Train the repository's custom classifier or regressor,
> inspect uncertainty, and reproduce its baseline comparisons. →
> [**Explore the algorithm**](algorithms/aprl/README.md)
>
> **📚 Learn and retrieve from the knowledge base.** Every document is tagged into
> a 17-topic map; open the repository as an Obsidian vault or point an AI agent at
> it for answers grounded in papers and lectures. →
> [**Open in Obsidian / connect your agent**](#open-in-obsidian--connect-your-agent)

---

## Why this exists

The best material for learning machine learning is scattered across dozens of course pages, YouTube channels, arXiv PDFs, and personal blogs — each in a different format, none of it easy to search, embed, or feed to a model.
Machine learning repositories often provide either code without enough conceptual
context or learning material without a concrete system to experiment with. This
project keeps both in one place: APRL provides an inspectable learning algorithm,
while the curated corpus provides the theory, provenance, and educational context
around it.

This repo pulls the highest-signal sources into **one place**, in **one consistent format**, with **clean metadata on every file**. The curation is the point: instead of an undifferentiated dump of arXiv or a noisy web scrape, this is a deliberately chosen reading list spanning the whole field — from "what is a neural network" all the way to sparse-attention and reasoning-model papers from 2025.
The best material for learning machine learning is scattered across course pages,
YouTube channels, arXiv PDFs, and personal blogs. The knowledge-base layer pulls
high-signal sources into **one place**, in **one consistent format**, with **clean
metadata on every file**. Instead of an undifferentiated dump, it is a deliberately
chosen collection spanning fundamentals through frontier research.

It's designed to be **used by both humans and machines**: read it directly to learn, or drop it into a vector database to build a retrieval-augmented tutor, fine-tune a domain model, or benchmark embeddings.
Use the repository to train and evaluate APRL, study how the algorithm is built,
read the corpus directly, build retrieval systems, benchmark embeddings, or ground
an AI tutor in attributed sources.

---

## At a glance

| | |
|---|---|
| **Custom algorithm** | APRL classifier + regressor for numeric tabular data |
| **Algorithm capabilities** | Local nonlinear residuals, uncertainty, missing values, incremental batches |
| **Algorithm evidence** | 11 tests + reproducible five-dataset smoke benchmark |
| **Total documents** | 923 |
| **Total size** | ~42M characters (~11M tokens) |
| **arXiv papers** | 391 (78 full-text + 313 recent abstract+metadata) |
Expand All @@ -44,6 +70,19 @@ Every file begins with structured frontmatter (title, source, URL, authors, date

## What's inside

### Custom ML algorithm (`src/aprl/`)

**Adaptive Prototype Residual Learning (APRL)** combines a global ridge model
with relevance-weighted prototypes and local polynomial experts that correct the
global model's residual errors. It provides classification, regression,
distance-aware uncertainty, missing-value handling, and exact incremental batch
updates through a NumPy-only runtime. The implementation is backed by tests,
benchmarks, mathematical documentation, and a conservative related-work review.

APRL is a custom experimental composition, not a claim of scientific novelty or
state-of-the-art performance. See the [algorithm guide](algorithms/aprl/README.md)
and [reproducible results](algorithms/aprl/BENCHMARKS.md).

### Research papers (`corpus/papers/` — 391)

The 78 canonical papers in **full text**, plus **313 recent (2024H2–2026)** papers added as the **verbatim abstract + metadata** (with a link to the full paper). Foundational to frontier:
Expand Down Expand Up @@ -104,9 +143,14 @@ machine-learning-library/
│ └── paths/ ← curated reading paths (Zero to Transformer, …)
├── .obsidian/ ← bundled vault config — open the folder in Obsidian and it just works
├── tools/ ← scripts that clean, tag, and index the corpus
├── algorithms/aprl/ ← APRL specification, benchmarks, and related work
├── src/aprl/ ← installable APRL classifier and regressor
├── tests/ ← APRL behavioral test suite
├── benchmarks/ ← reproducible model comparisons
└── examples/
├── self-attention-study-note.md ← a synthesized, fully-cited study note
└── rag_quickstart.py ← minimal semantic search / RAG over the corpus
├── rag_quickstart.py ← minimal semantic search / RAG over the corpus
└── aprl_quickstart.py ← APRL classification/regression example
```

### Frontmatter format
Expand Down Expand Up @@ -155,6 +199,23 @@ This corpus is a building block. Some of the things it's good for:

7. **Offline reference library.** It's just Markdown — grep it, open it in Obsidian, read it on a plane.

### Custom machine-learning algorithm: APRL

The repository now also contains **Adaptive Prototype Residual Learning (APRL)**,
a custom experimental algorithm for numeric tabular classification and regression.
It combines a global ridge model, relevance-weighted prototypes, local polynomial
residual experts, distance-aware blending, and uncertainty estimates.

```bash
python -m pip install -e .
python examples/aprl_quickstart.py
```

Start with [`algorithms/aprl/README.md`](algorithms/aprl/README.md) for the full
mathematical specification, limitations, API, tests, related work, and reproducible
baseline benchmarks. APRL is presented as an experimental custom composition—not
as a proven state-of-the-art or scientifically novel method.

---

## Quick start
Expand Down Expand Up @@ -237,5 +298,5 @@ See **[NOTICE.md](NOTICE.md)** for licensing details and the takedown/removal po

## License

- The **structure, index, scripts, and organization** of this repository are released under the MIT License.
- The **structure, index, scripts, APRL implementation, and organization** of this repository are released under the MIT License.
- The **content of each document** remains under the rights of its original author/publisher and is included here for research and educational purposes. See [NOTICE.md](NOTICE.md).
47 changes: 47 additions & 0 deletions algorithms/aprl/BENCHMARKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Custom APRL Algorithm: Baseline Benchmark

Results use 5-fold cross-validation with seed `42`. Classification reports accuracy; regression reports R². Values are mean ± population standard deviation across folds.

> These small built-in datasets are smoke benchmarks, not evidence of state-of-the-art performance or scientific novelty. Runtime is machine-dependent.

## Classification

| Dataset | Model | Score | Runtime (s) |
|---|---|---:|---:|
| Iris | APRL | 0.953 ± 0.045 | 0.030 |
| Iris | Logistic regression | 0.953 ± 0.045 | 0.041 |
| Iris | K-nearest neighbors | 0.973 ± 0.025 | 0.022 |
| Iris | Random forest | 0.960 ± 0.039 | 1.477 |
| Wine | APRL | 0.983 ± 0.014 | 0.044 |
| Wine | Logistic regression | 0.983 ± 0.014 | 0.046 |
| Wine | K-nearest neighbors | 0.972 ± 0.018 | 0.023 |
| Wine | Random forest | 0.977 ± 0.021 | 1.291 |
| Breast cancer | APRL | 0.968 ± 0.013 | 0.131 |
| Breast cancer | Logistic regression | 0.974 ± 0.017 | 0.042 |
| Breast cancer | K-nearest neighbors | 0.963 ± 0.018 | 2.193 |
| Breast cancer | Random forest | 0.954 ± 0.010 | 1.910 |

## Regression

| Dataset | Model | Score | Runtime (s) |
|---|---|---:|---:|
| Diabetes | APRL | 0.492 ± 0.078 | 0.053 |
| Diabetes | Ridge | 0.479 ± 0.083 | 0.014 |
| Diabetes | K-nearest neighbors | 0.391 ± 0.040 | 0.017 |
| Diabetes | Random forest | 0.427 ± 0.093 | 1.924 |
| Friedman #1 | APRL | 0.899 ± 0.021 | 0.063 |
| Friedman #1 | Ridge | 0.745 ± 0.030 | 0.014 |
| Friedman #1 | K-nearest neighbors | 0.648 ± 0.047 | 0.019 |
| Friedman #1 | Random forest | 0.827 ± 0.022 | 2.733 |

## Environment

- Python: `3.12.10`
- NumPy: `2.5.2`
- scikit-learn: `1.9.0`

Regenerate from the repository root:

```bash
python benchmarks/benchmark_aprl.py --output algorithms/aprl/BENCHMARKS.md
```
Loading
Loading