Contents - Chapters
1 What is Data Science?
2 Mathematical Preliminaries
3 Data Munging
4 Scores and Rankings
5 Statistical Analysis
6 Visualizing Data
7 Mathematical Models
8 Linear Algebra
9 Linear and Logistic Regression
10 Distance and Network Methods
11 Machine Learning
12 Big Data: Achieving Scale
13 Coda
14 Bibliography 427
Contents
1 What is Data Science? 1
1.1 ComputerScience,DataScience,andRealScience . . . . . . . . 2
1.2 AskingInterestingQuestionsfromData . . . . . . . . . . . . . . 4
1.2.1 TheBaseballEncyclopedia . . . . . . . . . . . . . . . . . 5
1.2.2 TheInternetMovieDatabase(IMDb) . . . . . . . . . . . 7
1.2.3 GoogleNgrams . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.4 NewYorkTaxiRecords . . . . . . . . . . . . . . . . . . . 11
1.3 PropertiesofData . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.1 Structuredvs.UnstructuredData . . . . . . . . . . . . . 14
1.3.2 Quantitativevs.CategoricalData . . . . . . . . . . . . . 15
1.3.3 BigDatavs.LittleData. . . . . . . . . . . . . . . . . . . 15
1.4 ClassificationandRegression . . . . . . . . . . . . . . . . . . . . 16
1.5 DataScienceTelevision:TheQuantShop . . . . . . . . . . . . . 17
1.5.1 KaggleChallenges . . . . . . . . . . . . . . . . . . . . . . 19
1.6 AbouttheWarStories . . . . . . . . . . . . . . . . . . . . . . . . 19
1.7 WarStory:AnsweringtheRightQuestion . . . . . . . . . . . . . 21
1.8 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2 MathematicalPreliminaries 27
2.1 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.1 Probabilityvs.Statistics . . . . . . . . . . . . . . . . . . . 29
2.1.2 CompoundEventsandIndependence. . . . . . . . . . . . 30
2.1.3 ConditionalProbability . . . . . . . . . . . . . . . . . . . 31
2.1.4 ProbabilityDistributions . . . . . . . . . . . . . . . . . . 32
2.2 DescriptiveStatistics . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.2.1 CentralityMeasures . . . . . . . . . . . . . . . . . . . . . 34
2.2.2 VariabilityMeasures . . . . . . . . . . . . . . . . . . . . . 36
2.2.3 InterpretingVariance . . . . . . . . . . . . . . . . . . . . 37
2.2.4 CharacterizingDistributions . . . . . . . . . . . . . . . . 39
2.3 CorrelationAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.3.1 CorrelationCoefficients:PearsonandSpearmanRank . . 41
2.3.2 ThePowerandSignificanceofCorrelation. . . . . . . . . 43
2.3.3 CorrelationDoesNotImplyCausation! . . . . . . . . . . 45
xi
xii CONTENTS
2.3.4 DetectingPeriodicitiesbyAutocorrelation. . . . . . . . . 46
2.4 Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.4.1 LogarithmsandMultiplyingProbabilities . . . . . . . . . 48
2.4.2 LogarithmsandRatios. . . . . . . . . . . . . . . . . . . . 48
2.4.3 LogarithmsandNormalizingSkewedDistributions . . . . 49
2.5 WarStory:FittingDesignerGenes . . . . . . . . . . . . . . . . . 50
2.6 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3 DataMunging 57
3.1 LanguagesforDataScience . . . . . . . . . . . . . . . . . . . . . 57
3.1.1 TheImportanceofNotebookEnvironments . . . . . . . . 59
3.1.2 StandardDataFormats . . . . . . . . . . . . . . . . . . . 61
3.2 CollectingData . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.1 Hunting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.2.2 Scraping. . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.2.3 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.3 CleaningData . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.3.1 Errorsvs.Artifacts . . . . . . . . . . . . . . . . . . . . . 69
3.3.2 DataCompatibility. . . . . . . . . . . . . . . . . . . . . . 72
3.3.3 DealingwithMissingValues. . . . . . . . . . . . . . . . . 76
3.3.4 OutlierDetection. . . . . . . . . . . . . . . . . . . . . . . 78
3.4 WarStory:BeatingtheMarket . . . . . . . . . . . . . . . . . . . 79
3.5 Crowdsourcing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.5.1 ThePennyDemo . . . . . . . . . . . . . . . . . . . . . . . 81
3.5.2 WhenistheCrowdWise? . . . . . . . . . . . . . . . . . . 82
3.5.3 MechanismsforAggregation . . . . . . . . . . . . . . . . 83
3.5.4 CrowdsourcingServices . . . . . . . . . . . . . . . . . . . 84
3.5.5 Gamification . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.6 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4 ScoresandRankings 95
4.1 TheBodyMassIndex(BMI) . . . . . . . . . . . . . . . . . . . . 96
4.2 DevelopingScoringSystems . . . . . . . . . . . . . . . . . . . . . 99
4.2.1 GoldStandardsandProxies . . . . . . . . . . . . . . . . . 99
4.2.2 Scoresvs.Rankings . . . . . . . . . . . . . . . . . . . . . 100
4.2.3 RecognizingGoodScoringFunctions . . . . . . . . . . . . 101
4.3 Z-scoresandNormalization . . . . . . . . . . . . . . . . . . . . . 103
4.4 AdvancedRankingTechniques . . . . . . . . . . . . . . . . . . . 104
4.4.1 EloRankings . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.4.2 MergingRankings . . . . . . . . . . . . . . . . . . . . . . 108
4.4.3 Digraph-basedRankings . . . . . . . . . . . . . . . . . . . 109
4.4.4 PageRank . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
4.5 WarStory:Clyde’sRevenge . . . . . . . . . . . . . . . . . . . . . 111
4.6 Arrow’sImpossibilityTheorem . . . . . . . . . . . . . . . . . . . 114
CONTENTS xiii
4.7 WarStory:Who’sBigger?. . . . . . . . . . . . . . . . . . . . . . 115
4.8 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
5 StatisticalAnalysis 121
5.1 StatisticalDistributions . . . . . . . . . . . . . . . . . . . . . . . 122
5.1.1 TheBinomialDistribution. . . . . . . . . . . . . . . . . . 123
5.1.2 TheNormalDistribution . . . . . . . . . . . . . . . . . . 124
5.1.3 ImplicationsoftheNormalDistribution . . . . . . . . . . 126
5.1.4 PoissonDistribution . . . . . . . . . . . . . . . . . . . . . 127
5.1.5 PowerLawDistributions. . . . . . . . . . . . . . . . . . . 129
5.2 SamplingfromDistributions. . . . . . . . . . . . . . . . . . . . . 132
5.2.1 RandomSamplingbeyondOneDimension. . . . . . . . . 133
5.3 StatisticalSignificance . . . . . . . . . . . . . . . . . . . . . . . . 135
5.3.1 TheSignificanceofSignificance . . . . . . . . . . . . . . . 135
5.3.2 TheT-test:ComparingPopulationMeans . . . . . . . . . 137
5.3.3 TheKolmogorov-SmirnovTest . . . . . . . . . . . . . . . 139
5.3.4 TheBonferroniCorrection. . . . . . . . . . . . . . . . . . 141
5.3.5 FalseDiscoveryRate . . . . . . . . . . . . . . . . . . . . . 142
5.4 WarStory:DiscoveringtheFountainofYouth? . . . . . . . . . . 143
5.5 PermutationTestsandP-values . . . . . . . . . . . . . . . . . . . 145
5.5.1 GeneratingRandomPermutations . . . . . . . . . . . . . 147
5.5.2 DiMaggio’sHittingStreak. . . . . . . . . . . . . . . . . . 148
5.6 BayesianReasoning . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.7 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6 VisualizingData 155
6.1 ExploratoryDataAnalysis. . . . . . . . . . . . . . . . . . . . . . 156
6.1.1 ConfrontingaNewDataSet . . . . . . . . . . . . . . . . 156
6.1.2 SummaryStatisticsandAnscombe’sQuartet . . . . . . . 159
6.1.3 VisualizationTools . . . . . . . . . . . . . . . . . . . . . . 160
6.2 DevelopingaVisualizationAesthetic . . . . . . . . . . . . . . . . 162
6.2.1 MaximizingData-InkRatio . . . . . . . . . . . . . . . . . 163
6.2.2 MinimizingtheLieFactor . . . . . . . . . . . . . . . . . . 164
6.2.3 MinimizingChartjunk . . . . . . . . . . . . . . . . . . . . 165
6.2.4 ProperScalingandLabeling . . . . . . . . . . . . . . . . 167
6.2.5 EffectiveUseofColorandShading . . . . . . . . . . . . . 168
6.2.6 ThePowerofRepetition. . . . . . . . . . . . . . . . . . . 169
6.3 ChartTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.3.1 TabularData . . . . . . . . . . . . . . . . . . . . . . . . . 170
6.3.2 DotandLinePlots . . . . . . . . . . . . . . . . . . . . . . 174
6.3.3 ScatterPlots . . . . . . . . . . . . . . . . . . . . . . . . . 177
6.3.4 BarPlotsandPieCharts . . . . . . . . . . . . . . . . . . 179
6.3.5 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.3.6 DataMaps . . . . . . . . . . . . . . . . . . . . . . . . . . 187
xiv CONTENTS
6.4 GreatVisualizations . . . . . . . . . . . . . . . . . . . . . . . . . 189
6.4.1 Marey’sTrainSchedule . . . . . . . . . . . . . . . . . . . 189
6.4.2 Snow’sCholeraMap . . . . . . . . . . . . . . . . . . . . . 191
6.4.3 NewYork’sWeatherYear . . . . . . . . . . . . . . . . . . 192
6.5 ReadingGraphs. . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
6.5.1 TheObscuredDistribution . . . . . . . . . . . . . . . . . 193
6.5.2 OverinterpretingVariance . . . . . . . . . . . . . . . . . . 193
6.6 InteractiveVisualization . . . . . . . . . . . . . . . . . . . . . . . 195
6.7 WarStory:TextMappingtheWorld . . . . . . . . . . . . . . . . 196
6.8 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
6.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
7 MathematicalModels 201
7.1 PhilosophiesofModeling. . . . . . . . . . . . . . . . . . . . . . . 201
7.1.1 Occam’sRazor . . . . . . . . . . . . . . . . . . . . . . . . 201
7.1.2 Bias–VarianceTrade-Offs . . . . . . . . . . . . . . . . . . 202
7.1.3 WhatWouldNateSilverDo? . . . . . . . . . . . . . . . . 203
7.2 ATaxonomyofModels . . . . . . . . . . . . . . . . . . . . . . . 205
7.2.1 Linearvs.Non-LinearModels . . . . . . . . . . . . . . . . 206
7.2.2 Blackboxvs.DescriptiveModels . . . . . . . . . . . . . . 206
7.2.3 First-Principlevs.Data-DrivenModels. . . . . . . . . . . 207
7.2.4 Stochasticvs.DeterministicModels . . . . . . . . . . . . 208
7.2.5 Flatvs.HierarchicalModels. . . . . . . . . . . . . . . . . 209
7.3 BaselineModels. . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
7.3.1 BaselineModelsforClassification. . . . . . . . . . . . . . 210
7.3.2 BaselineModelsforValuePrediction. . . . . . . . . . . . 212
7.4 EvaluatingModels . . . . . . . . . . . . . . . . . . . . . . . . . . 212
7.4.1 EvaluatingClassifiers . . . . . . . . . . . . . . . . . . . . 213
7.4.2 Receiver-OperatorCharacteristic(ROC)Curves . . . . . 218
7.4.3 EvaluatingMulticlassSystems . . . . . . . . . . . . . . . 219
7.4.4 EvaluatingValuePredictionModels . . . . . . . . . . . . 221
7.5 EvaluationEnvironments . . . . . . . . . . . . . . . . . . . . . . 224
7.5.1 DataHygieneforEvaluation . . . . . . . . . . . . . . . . 225
7.5.2 AmplifyingSmallEvaluationSets . . . . . . . . . . . . . 226
7.6 WarStory: 100%Accuracy . . . . . . . . . . . . . . . . . . . . . 228
7.7 SimulationModels . . . . . . . . . . . . . . . . . . . . . . . . . . 229
7.8 WarStory:CalculatedBets . . . . . . . . . . . . . . . . . . . . . 230
7.9 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
7.10Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
8 LinearAlgebra 237
8.1 ThePowerofLinearAlgebra . . . . . . . . . . . . . . . . . . . . 237
8.1.1 InterpretingLinearAlgebraicFormulae . . . . . . . . . . 238
8.1.2 GeometryandVectors . . . . . . . . . . . . . . . . . . . . 240
8.2 VisualizingMatrixOperations. . . . . . . . . . . . . . . . . . . . 241
8.2.1 MatrixAddition . . . . . . . . . . . . . . . . . . . . . . . 242
CONTENTS xv
8.2.2 MatrixMultiplication . . . . . . . . . . . . . . . . . . . . 243
8.2.3 ApplicationsofMatrixMultiplication . . . . . . . . . . . 244
8.2.4 IdentityMatricesandInversion . . . . . . . . . . . . . . . 248
8.2.5 MatrixInversionandLinearSystems . . . . . . . . . . . . 250
8.2.6 MatrixRank . . . . . . . . . . . . . . . . . . . . . . . . . 251
8.3 FactoringMatrices . . . . . . . . . . . . . . . . . . . . . . . . . . 252
8.3.1 WhyFactorFeatureMatrices? . . . . . . . . . . . . . . . 252
8.3.2 LUDecompositionandDeterminants . . . . . . . . . . . 254
8.4 EigenvaluesandEigenvectors . . . . . . . . . . . . . . . . . . . . 255
8.4.1 PropertiesofEigenvalues . . . . . . . . . . . . . . . . . . 255
8.4.2 ComputingEigenvalues . . . . . . . . . . . . . . . . . . . 256
8.5 EigenvalueDecomposition . . . . . . . . . . . . . . . . . . . . . . 257
8.5.1 SingularValueDecomposition. . . . . . . . . . . . . . . . 258
8.5.2 PrincipalComponentsAnalysis . . . . . . . . . . . . . . . 260
8.6 WarStory:TheHumanFactors. . . . . . . . . . . . . . . . . . . 262
8.7 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
8.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
9 LinearandLogisticRegression 267
9.1 LinearRegression. . . . . . . . . . . . . . . . . . . . . . . . . . . 268
9.1.1 LinearRegressionandDuality . . . . . . . . . . . . . . . 268
9.1.2 ErrorinLinearRegression. . . . . . . . . . . . . . . . . . 269
9.1.3 FindingtheOptimalFit . . . . . . . . . . . . . . . . . . . 270
9.2 BetterRegressionModels . . . . . . . . . . . . . . . . . . . . . . 272
9.2.1 RemovingOutliers . . . . . . . . . . . . . . . . . . . . . . 272
9.2.2 FittingNon-LinearFunctions . . . . . . . . . . . . . . . . 273
9.2.3 FeatureandTargetScaling . . . . . . . . . . . . . . . . . 274
9.2.4 DealingwithHighly-CorrelatedFeatures . . . . . . . . . . 277
9.3 WarStory:TaxiDeriver . . . . . . . . . . . . . . . . . . . . . . . 277
9.4 RegressionasParameterFitting . . . . . . . . . . . . . . . . . . 279
9.4.1 ConvexParameterSpaces . . . . . . . . . . . . . . . . . . 280
9.4.2 GradientDescentSearch. . . . . . . . . . . . . . . . . . . 281
9.4.3 What istheRightLearningRate? . . . . . . . . . . . . . 283
9.4.4 StochasticGradientDescent. . . . . . . . . . . . . . . . . 285
9.5 SimplifyingModelsthroughRegularization . . . . . . . . . . . . 286
9.5.1 RidgeRegression . . . . . . . . . . . . . . . . . . . . . . . 286
9.5.2 LASSORegression . . . . . . . . . . . . . . . . . . . . . . 287
9.5.3 Trade-OffsbetweenFitandComplexity . . . . . . . . . . 288
9.6 ClassificationandLogisticRegression . . . . . . . . . . . . . . . 289
9.6.1 RegressionforClassification. . . . . . . . . . . . . . . . . 290
9.6.2 DecisionBoundaries . . . . . . . . . . . . . . . . . . . . . 291
9.6.3 LogisticRegression . . . . . . . . . . . . . . . . . . . . . . 292
9.7 IssuesinLogisticClassification . . . . . . . . . . . . . . . . . . . 295
9.7.1 BalancedTrainingClasses . . . . . . . . . . . . . . . . . . 295
9.7.2 Multi-ClassClassification . . . . . . . . . . . . . . . . . . 297
9.7.3 HierarchicalClassification . . . . . . . . . . . . . . . . . . 298
9.7.4 PartitionFunctionsandMultinomialRegression . . . . . 299
9.8 ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
9.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
10DistanceandNetworkMethods 303
10.1MeasuringDistances . . . . . . . . . . . . . . . . . . . . . . . . . 303
10.1.1 DistanceMetrics . . . . . . . . . . . . . . . . . . . . . . . 304
10.1.2 TheLkDistanceMetric . . . . . . . . . . . . . . . . . . . 305
10.1.3WorkinginHigherDimensions . . . . . . . . . . . . . . . 307
10.1.4 DimensionalEgalitarianism . . . . . . . . . . . . . . . . . 308
10.1.5 Pointsvs.Vectors . . . . . . . . . . . . . . . . . . . . . . 309
10.1.6 DistancesbetweenProbabilityDistributions . . . . . . . . 310
10.2NearestNeighborClassification . . . . . . . . . . . . . . . . . . . 311
10.2.1 SeekingGoodAnalogies . . . . . . . . . . . . . . . . . . . 312
10.2.2 k-NearestNeighbors . . . . . . . . . . . . . . . . . . . . . 313
10.2.3 FindingNearestNeighbors . . . . . . . . . . . . . . . . . 315
10.2.4 LocalitySensitiveHashing. . . . . . . . . . . . . . . . . . 317
10.3Graphs,Networks,andDistances . . . . . . . . . . . . . . . . . . 319
10.3.1WeightedGraphsandInducedNetworks . . . . . . . . . . 320
10.3.2 TalkingAboutGraphs . . . . . . . . . . . . . . . . . . . . 321
10.3.3 GraphTheory . . . . . . . . . . . . . . . . . . . . . . . . 323
10.4PageRank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
10.5Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
10.5.1 k-meansClustering. . . . . . . . . . . . . . . . . . . . . . 330
10.5.2 AgglomerativeClustering . . . . . . . . . . . . . . . . . . 336
10.5.3 ComparingClusterings. . . . . . . . . . . . . . . . . . . . 341
10.5.4 SimilarityGraphsandCut-BasedClustering . . . . . . . 341
10.6WarStory:ClusterBombing . . . . . . . . . . . . . . . . . . . . 344
10.7ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
10.8Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
11MachineLearning 351
11.1NaiveBayes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
11.1.1 Formulation. . . . . . . . . . . . . . . . . . . . . . . . . . 354
11.1.2 DealingwithZeroCounts(Discounting) . . . . . . . . . . 356
11.2DecisionTreeClassifiers . . . . . . . . . . . . . . . . . . . . . . . 357
11.2.1 ConstructingDecisionTrees . . . . . . . . . . . . . . . . . 359
11.2.2 RealizingExclusiveOr . . . . . . . . . . . . . . . . . . . . 361
11.2.3 EnsemblesofDecisionTrees . . . . . . . . . . . . . . . . . 362
11.3BoostingandEnsembleLearning . . . . . . . . . . . . . . . . . . 363
11.3.1 VotingwithClassifiers . . . . . . . . . . . . . . . . . . . . 363
11.3.2 BoostingAlgorithms . . . . . . . . . . . . . . . . . . . . . 364
11.4SupportVectorMachines . . . . . . . . . . . . . . . . . . . . . . 366
11.4.1 LinearSVMs . . . . . . . . . . . . . . . . . . . . . . . . . 369
11.4.2 Non-linearSVMs . . . . . . . . . . . . . . . . . . . . . . . 369
11.4.3 Kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
CONTENTS xvii
11.5DegreesofSupervision . . . . . . . . . . . . . . . . . . . . . . . . 372
11.5.1 SupervisedLearning . . . . . . . . . . . . . . . . . . . . . 372
11.5.2 UnsupervisedLearning. . . . . . . . . . . . . . . . . . . . 372
11.5.3 Semi-supervisedLearning . . . . . . . . . . . . . . . . . . 374
11.5.4 FeatureEngineering . . . . . . . . . . . . . . . . . . . . . 375
11.6DeepLearning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
11.6.1 NetworksandDepth . . . . . . . . . . . . . . . . . . . . . 378
11.6.2 Backpropagation . . . . . . . . . . . . . . . . . . . . . . . 382
11.6.3WordandGraphEmbeddings. . . . . . . . . . . . . . . . 383
11.7WarStory:TheNameGame . . . . . . . . . . . . . . . . . . . . 385
11.8ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
11.9Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
12BigData:AchievingScale 391
12.1What isBigData? . . . . . . . . . . . . . . . . . . . . . . . . . . 392
12.1.1 BigDataasBadData . . . . . . . . . . . . . . . . . . . . 392
12.1.2 TheThreeVs . . . . . . . . . . . . . . . . . . . . . . . . . 394
12.2WarStory: InfrastructureMatters . . . . . . . . . . . . . . . . . 395
12.3AlgorithmicsforBigData . . . . . . . . . . . . . . . . . . . . . . 397
12.3.1 BigOhAnalysis . . . . . . . . . . . . . . . . . . . . . . . 397
12.3.2 Hashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
12.3.3 ExploitingtheStorageHierarchy . . . . . . . . . . . . . . 401
12.3.4 StreamingandSingle-PassAlgorithms . . . . . . . . . . . 402
12.4FilteringandSampling. . . . . . . . . . . . . . . . . . . . . . . . 403
12.4.1 DeterministicSamplingAlgorithms. . . . . . . . . . . . . 404
12.4.2 RandomizedandStreamSampling . . . . . . . . . . . . . 406
12.5Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
12.5.1 One,Two,Many . . . . . . . . . . . . . . . . . . . . . . . 407
12.5.2 DataParallelism . . . . . . . . . . . . . . . . . . . . . . . 409
12.5.3 GridSearch . . . . . . . . . . . . . . . . . . . . . . . . . . 409
12.5.4 CloudComputingServices. . . . . . . . . . . . . . . . . . 410
12.6MapReduce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
12.6.1Map-ReduceProgramming . . . . . . . . . . . . . . . . . 412
12.6.2MapReduceundertheHood. . . . . . . . . . . . . . . . . 414
12.7SocietalandEthical Implications . . . . . . . . . . . . . . . . . . 416
12.8ChapterNotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
12.9Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
13Coda 423
13.1GetaJob! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
13.2GotoGraduateSchool! . . . . . . . . . . . . . . . . . . . . . . . 424
13.3ProfessionalConsultingServices . . . . . . . . . . . . . . . . . . 425
14Bibliography 427