182
PG 594: Big Data – Zwischenbericht – 31. M¨ arz 2016 Autoren: Asmi, Mohamed Bainczyk, Alexander Bunse, Mirko Gaidel, Dennis May, Michael Pfeiffer, Christian Schieweck, Alexander Sch¨ onberger, Lea Stelzner, Karl Sturm, David Wiethoff, Carolin Xu, Lili Betreuer: Prof. Dr. Morik, Katharina Dr. Bockermann, Christian Blom, Hendrik

PG594: Big Data - · PDF filePG594: Big Data – Zwischenbericht – 31. M¨arz 2016 Autoren: Asmi, Mohamed Bainczyk, Alexander Bunse, Mirko Gaidel, Dennis May, Michael Pfeiffer

  • Upload
    dodung

  • View
    220

  • Download
    1

Embed Size (px)

Citation preview

  • PG 594: Big Data

    Zwischenbericht

    31. Marz 2016

    Autoren:

    Asmi, MohamedBainczyk, AlexanderBunse, MirkoGaidel, DennisMay, MichaelPfeiffer, Christian

    Schieweck, AlexanderSchonberger, LeaStelzner, KarlSturm, DavidWiethoff, CarolinXu, Lili

    Betreuer:

    Prof. Dr. Morik, KatharinaDr. Bockermann, Christian

    Blom, Hendrik

  • Inhaltsverzeichnis

    I Einfuhrung 1

    1 Einleitung 3

    1.1 Anwendungsfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.2 Aufbau der Arbeit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2 Organisation 7

    2.1 Agiles Projektmanagement . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    2.1.1 Probleme Nicht-Agiler Verfahren . . . . . . . . . . . . . . . . . . . . 8

    2.1.2 Das Agile Manifest . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    2.1.3 Scrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    2.1.4 Kanban . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    2.2 Wahl des Verfahrens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    2.3 Retrospektive der Umsetzung . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.3.1 Projekt-Initialisierung . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.3.2 Meetings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.3.3 Abschlieende Bewertung . . . . . . . . . . . . . . . . . . . . . . . . 15

    II Big Data Analytics 17

    3 Einfuhrung in Big Data Systeme 19

    3.1 Nutzen von Big Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.2 Probleme mit herkommlichen Ansatzen . . . . . . . . . . . . . . . . . . . . 20

    3.3 Anforderungen an Big Data Systeme . . . . . . . . . . . . . . . . . . . . . . 21

    i

  • ii INHALTSVERZEICHNIS

    4 Lambda-Architektur 23

    5 Batch Layer 27

    5.1 Apache Hadoop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    5.1.1 HDFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    5.1.2 YARN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    5.1.3 MapReduce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    5.2 Apache Spark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    5.2.1 Spark Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    5.2.2 Spark SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    5.2.3 Spark MLlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    6 Speed Layer 37

    6.1 Apache Storm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    6.1.1 Storm Topologien . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    6.1.2 Storm Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    6.2 Apache Trident . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    6.2.1 Trident Topologien . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    6.3 Spark Streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    6.4 streams-Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    7 Serving Layer 45

    7.1 Datenbanken . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    7.1.1 MongoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    7.1.2 Elasticsearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    7.1.3 Cassandra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    7.1.4 PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    7.2 RESTful APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    7.2.1 Grundlegende Idee . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    7.2.2 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    7.2.3 JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

  • INHALTSVERZEICHNIS iii

    8 Maschinelles Lernen 55

    8.1 Ensemble Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    8.1.1 Bagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    8.1.2 Boosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    8.1.3 Fazit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    8.2 Clustering und Subgruppenentdeckung . . . . . . . . . . . . . . . . . . . . . 61

    8.2.1 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    8.2.2 Subgruppenentdeckung . . . . . . . . . . . . . . . . . . . . . . . . . 64

    8.3 Verteiltes Lernen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    8.4 Statisches und Inkrementelles Lernen . . . . . . . . . . . . . . . . . . . . . . 68

    8.5 Concept Drift und Concept Shift . . . . . . . . . . . . . . . . . . . . . . . . 69

    8.6 Learning with Imbalanced Classes . . . . . . . . . . . . . . . . . . . . . . . 71

    8.6.1 Einfluss auf Klassifikatoren . . . . . . . . . . . . . . . . . . . . . . . 71

    8.6.2 Bewertung von Klassifikatoren . . . . . . . . . . . . . . . . . . . . . 71

    8.6.3 Verbesserung von Klassifikatoren . . . . . . . . . . . . . . . . . . . . 73

    8.7 Feature Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    8.7.1 Vorteile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    8.7.2 Problemstellung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    8.7.3 Arten von Algorithmen . . . . . . . . . . . . . . . . . . . . . . . . . 78

    8.7.4 Korrelation als Heuristik . . . . . . . . . . . . . . . . . . . . . . . . . 79

    8.7.5 CFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

    8.7.6 Fast-Ensembles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    8.8 Sampling und Active Learning . . . . . . . . . . . . . . . . . . . . . . . . . 84

    8.8.1 Der naive Ansatz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    8.8.2 Re-Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    8.8.3 VLDS-Ada2Boost . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    8.8.4 Active Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    III Anwendungsfall 91

    9 Analyseziele 93

    9.1 Gamma/Hadron-Klassifizierung . . . . . . . . . . . . . . . . . . . . . . . . . 95

    9.2 Energie-Abschatzung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

  • iv INHALTSVERZEICHNIS

    10 Datenbeschreibung 97

    10.1 FITS-Dateiformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    10.2 Rohdaten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    10.3 Monte-Carlo-Daten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    10.4 Drs-Daten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    10.5 Aux-Daten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    11 Analyse mit den FACT Tools 101

    11.1 Analysekette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    11.1.1 Datensammlung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    11.1.2 Datenvorverarbeitung . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    11.1.3 Datenanalyse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    11.2 Grenzen von streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    IV Architektur und Umsetzung 105

    12 Komponenten und Architektur 107

    13 Indexierung der Rohdaten 111

    13.1 MongoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    13.2 Elasticsearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

    13.3 PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    14 Umsetzung der RESTful API 115

    14.1 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    14.1.1 Endpunkte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    14.1.2 Ruckgabeformate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    14.1.3 Dokumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    14.2 Implementierung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    14.2.1 Spring Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    14.2.2 Filterung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

  • INHALTSVERZEICHNIS v

    15 Erweiterung der Streams-Architektur 125

    15.1 Verteilte Streams-Prozesse mit Spark . . . . . . . . . . . . . . . . . . . . . . 126

    15.1.1 Nebenlaufigkeit der Verarbeitung . . . . . . . . . . . . . . . . . . . . 126

    15.1.2 XML-Spezifikation verteilter Prozesse . . . . . . . . . . . . . . . . . 127

    15.1.3 Verarbeitung der XML-Spezifikation . . . . . . . . . . . . . . . . . . 128

    15.1.4 Ansatz unter der Spark Core-Engine . . . . . . . . . . . . . . . . . . 128

    15.1.5 MultiStream-Generatoren . . . . . . . . . . . . . . . . . . . . . . . . 132

    15.2 MLLib in Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

    15.2.1 XML-Spezifikation von input . . . . . . . . . . . . . . . . . . . . . . 133

    15.2.2 XML-Spezifikation von task & operator . . . . . . . . . . . . . . . . 134

    15.2.3 XML-S