Chapter 23: Pearson Correlation¶
Programs of chapter 23 of the book Data Algorithms (O'Reilly, 2015), running on Spark 4.3.0.
Chapter notes: chap23/scala
Sample input: data/chap23/biomarkers.txt ยท data/chap23/biomarkers_files.txt
Run the commands from the repository folder after building the jar (Running the programs).
Spark (Java)¶
chap23.spark.AllVersusAllCorrelation¶
Source: AllVersusAllCorrelation.java
scripts/run_spark.sh org.dataalgorithms.chap23.spark.AllVersusAllCorrelation r2 data/chap23/biomarkers_files.txt
- Writes to
output/in the current directory; delete it first if it exists:rm -r output
Spark (Java 8 lambdas)¶
chap23.sparkwithlambda.AllVersusAllCorrelation¶
Source: AllVersusAllCorrelation.java
scripts/run_spark.sh org.dataalgorithms.chap23.sparkwithlambda.AllVersusAllCorrelation r2 data/chap23/biomarkers_files.txt
- Writes to
output/in the current directory; delete it first if it exists:rm -r output
Spark (Scala)¶
chap23.scala.AllVersusAllCorrelation¶
Source: AllVersusAllCorrelation.scala
scripts/run_spark.sh org.dataalgorithms.chap23.scala.AllVersusAllCorrelation r2 data/chap23/biomarkers.txt /tmp/data-algorithms/chap23.scala.AllVersusAllCorrelation/output
Java¶
chap23.correlation.TestPearson¶
Source: TestPearson.java
scripts/run_mapreduce.sh org.dataalgorithms.chap23.correlation.TestPearson
chap23.correlation.TestSpearman¶
Source: TestSpearman.java
scripts/run_mapreduce.sh org.dataalgorithms.chap23.correlation.TestSpearman