Sample input data¶
Small input files for testing and running the programs of the Data Algorithms book.
tools/programs.json lists the arguments (and inputs) of
every program; tools/run_programs.py runs them all.
More inputs are next to the source code (for example src/main/java/.../resources/).
Files marked made up are small samples written for the Spark 4.3.0 refresh (2026), in the record format each program expects; they are not data from the book.
| File | Used by | Origin |
|---|---|---|
chap02/stock_prices.txt |
chapter 2 (secondary sort, MapReduce) | made up |
chap03/cats.txt |
chapter 3 Top-10 (unique keys, with a tie) | made up |
chap03/urls.txt |
chapter 3 Top-N (non-unique keys) | made up |
chap05/sentences.txt |
chapter 5 relative frequency | made up |
chap07/transactions.txt |
chapter 7 market basket analysis | made up |
chap08/friends.txt, chap08/friends_mapreduce.txt |
chapter 8 common friends (Spark, MapReduce formats) | made up |
chap09/friends.txt |
chapter 9 friend recommendation | made up |
chap10/ratings.tsv |
chapter 10 movie recommendations | made up |
chap11/transactions.txt |
chapter 11 Markov model (25 customers) | from src/main/java/.../chap11/resources/smart_email_training.txt |
chap11/customer_states.txt |
chapter 11 state transition model | made up (random states) |
chap12/points.txt |
chapter 12 K-means (Scala) | made up |
chap14/tennis_training.txt, chap14/tennis_query.txt |
chapter 14 Naive Bayes | the classic "play tennis" data |
chap16/edges.txt |
chapter 16 triangle counting (2 triangles) | made up |
chap22/* |
chapter 22 t-test | made up |
chap23/biomarkers*.txt |
chapter 23 all-versus-all correlation | made up (random) |
chap26/bioset*.txt |
chapter 26 gene aggregation | made up (random) |
chap28/numbers.txt |
chapter 28 mean (monoids) | made up |
chap29/small_files/ |
chapter 29 small files | made up |
chapB01/words.txt |
bonus chapters B01, B02, B09, B12 (MapReduce) | made up |
chapB03/key_values.txt |
bonus chapter B03 per-key average | made up |
chapB07/people.txt |
bonus chapter B07 Spark SQL | made up |
chapB07/people.json |
bonus chapter B07 Spark SQL | Apache Spark examples (Apache License 2.0) |
chapB12/documents.txt |
bonus chapter B12 (Spark) | made up |
machinelearning/wikistats.txt |
Wikipedia K-means featurization | made up (random page views) |
machinelearning/wikistats_features.tsv |
OptimizedWikipediaKMeans |
output of Featurization on wikistats.txt |
machinelearning/tennis_*.txt |
machine learning Naive Bayes (tennis) | the classic "play tennis" data |
friends.txt, friends2.txt |
bonus chapter B10 friend recommendation | book repository |
rp1.txt, rp2.txt, rp3.txt |
bonus chapter B04 rank product | book repository |
sample.fasta, SP1.fq, sample.fastq |
chapters 17, 24 (DNA) | book repository |
sample_anagram.txt |
bonus chapter B05 anagrams | book repository |
nums1, nums2 |
bonus chapter B14 min/max | book repository |
student_alcohol_*.txt |
machine learning logistic regression | book repository |
people.txt, sample1.vcf, sample_lda_libsvm_data.txt |
(not used by a program) | book repository |