SlideShare une entreprise Scribd logo
1  sur  43
Introduction aux algorithmes
MapReduce
Mathieu Dumoulin (GRAAL), 14 Février 2014
Plan
 Introduction de la
problématique
 Tutoriel MapReduce
 Design d’algorithmes
MapReduce
 Tri, somme et calcul de
moyenne
 PageRank en MapReduce
 Conclusion
mathieu.dumoulin@gmail.com 2014-02-14
« Big Data »
Building new analytic applications based on new types of data, in
order to better serve your customers and drive a better competitive
advantage
- David McJannet, Hortonworks
Big data is high volume, high velocity, and/or high variety
information assets that require new forms of processing to enable
enhanced decision making, insight discovery and process optimization
- Gartner, updated definition of big data (2012)
mathieu.dumoulin@gmail.com 2014-02-14
Un outil spécialisé
Problèmes où Hadoop est envisageable:
 Trop de données (GB,TB,PB)
 Améliorer des résultats existants
 Obtenir de nouveaux résultats
 Combiner des données hétérogènes
 Croissance rapide (et constante) des données
 Temps de traitement lent (minutes, heures)
 Budgets limités
 Plusieurs ordinateurs déjà disponibles
mathieu.dumoulin@gmail.com 2014-02-14
Hadoop au cœur du big data
mathieu.dumoulin@gmail.com 2014-02-14
MapReduce au cœur de Hadoop
Hadoop MapReduce is a software framework for easily writing
applications which process vast amounts of data (multi-terabyte
data-sets) in-parallel on large clusters (thousands of nodes) of
commodity hardware in a reliable, fault-tolerant manner.
- Hadoop Tutorial, hadoop.apache.org
mathieu.dumoulin@gmail.com 2014-02-14
Gain d’utiliser Hadoop?
 Tout le travail de distribution, balancement de charge,
synchronisation et de gestion d’erreur est géré
automatiquement
 Il suffit de programmer Map et Reduce (Java, C++,
Python, bash, etc.)
 Une grappe Hadoop peut évoluer facilement en ajoutant
des nœuds en tout temps
 Hadoop offre un rapport performance-prix très
compétitif (Amazon EMS, réutilisation de PC existants,
aucun coûts de licences ni de matériel spécialisé HPC)
mathieu.dumoulin@gmail.com 2014-02-14
L’exemple WordCount
On veut trouver les k mots les plus fréquents dans une
collection de textes.
def word_count(text, k):
counts = defaultdict(int)
for word in text.split():
counts[word.lower()] += 1
return sorted(counts, key=counts.get, reverse=True)[:k]
Mais cette solution est-elle la bonne si le texte est très
grand?
Et s’il est très, très, …, très grand?
mathieu.dumoulin@gmail.com 2014-02-14
La taille en soit peut être un problème
Problème SolutionTaille
• 100M mots
• 1000M mots
• 100MM mots
• 1000MM mots
• Plus encore!
• Pas de problèmes
• Mémoire insuffisante
• Processeur insuffisant
• 1 ordinateur insuffisant
• Réseau insuffisant,
contrôleur surchargé
• Naïve avec 1 seul
ordinateur
• Utiliser le disque,
Fenêtre glissante
• Multithreading,
éliminer < N
• Distribuer le calcul
• MapReduce (ou
solution du même
ordre comme MPI,
etc.)
mathieu.dumoulin@gmail.com 2014-02-14
Tutoriel MapReduce
Map Reduce
mathieu.dumoulin@gmail.com 2014-02-14
Map et Reduce: la paire Clef-Valeur
Mapper:
(K,V) → (K’, V’)
Reducer:
(K’, [V’, V’,…]) → (K’’, V’’)
Données
(HDFS)
Données’
(HDFS)
mathieu.dumoulin@gmail.com 2014-02-14
MapReduce en action: WordCount illustré
mathieu.dumoulin@gmail.com 2014-02-14
Map et Reduce: Shuffle and Sort
Source: Data Intensive Text Processing with MapReduce, Jimmy Lin and Chris Dyer, 2010
mathieu.dumoulin@gmail.com 2014-02-14
Map et Reduce (moins simplifié)
 Les vrai opérateurs:
 Mapper
 Combiner
 Partitioner
 Reducer
mathieu.dumoulin@gmail.com 2014-02-14
Design d’algorithmes pour MapReduce
1- Il faut reformuler les algorithmes en fonctionnel:
2- La bande passante du
réseau est une ressource
limitée à optimiser:
mathieu.dumoulin@gmail.com 2014-02-14
Exemples choisis
 Exemples simples:
 Tri
 Somme
 Moyenne
 Un exemple complet:
PageRank
 Bonus:
K-Means (Lloyd’s algorithm)
mathieu.dumoulin@gmail.com 2014-02-14
Trier en MapReduce
 Propriété du réducteur: les paires sont traitée dans
l’ordre (selon la clef), les réducteurs sont aussi dans
l’ordre
Mapper:
Émettre l’élément à trier comme nouvelle clef
Reducer:
Aucun (i.e. fonction identité)
mathieu.dumoulin@gmail.com 2014-02-14
Calcul d’une somme (WordCount)
mathieu.dumoulin@gmail.com 2014-02-14
Amélioration: le combiner
mathieu.dumoulin@gmail.com 2014-02-14
Calcul de moyenne
Utiliser un combiner est il approprié? Si on reprend le reducer comme combiner,
l’algorithme est-il encore correct?mathieu.dumoulin@gmail.com 2014-02-14
Comment améliorer ce calcul?
mathieu.dumoulin@gmail.com 2014-02-14
Design d’une solution MapReduce pour
l’algorithme PageRank
mathieu.dumoulin@gmail.com 2014-02-14
Qu’est-ce que PageRank?
Distribution de probabilité sur les pages web qui
représente la chance qu’un utilisateur naviguant au
hasard arrive à une page web particulière.
Notes:
 Le web est un graphe orienté, une page est un nœud
et les hyperliens sont des arcs.
 L’algorithme recalcule la probabilité de toutes les
pages itérativement jusqu’à convergence
mathieu.dumoulin@gmail.com 2014-02-14
Comment calculer PageRank (simplifié)
𝑃𝑅 𝑝𝑖 =
𝑝 𝑖∈𝑀(𝑝 𝑖)
𝑃𝑅(𝑝𝑗)
𝐿(𝑝𝑗)
• p1,p2,…,pN sont les pages web (les nœuds du
graphe)
• M(pi) est l’ensemble des pages ayant un lien vers pi
• L(pj) est le nombre de liens sortant de la page pj
• N est le nombre total de pages web
Note: Pour simplifier, on élimine le facteur d’atténuation, paramétrisé par
la probabilité que l’utilisateur arrête de naviguer.
Page, Lawrence and Brin, Sergey and Motwani, Rajeev and Winograd, Terry (1999) The
PageRank Citation Ranking: Bringing Order to theWeb. Technical Report. Stanford InfoLab.
mathieu.dumoulin@gmail.com 2014-02-14
PageRank par un exemple
Le web a trois pages web:A, B et C
Initialisation: PR(A) = PR(B) = PR(C) = 0.33
Jusqu’à convergence:
𝑃𝑅 𝐴 =
𝑃𝑅(𝐵)
2
𝑃𝑅 𝐵 =
𝑃𝑅(𝐴)
2
𝑃𝑅 𝐶 =
𝑃𝑅(𝐴)
2
+
𝑃𝑅(𝐵)
2
mathieu.dumoulin@gmail.com 2014-02-14
PageRank en MapReduce
Donnés de départ:
collection de pages web (URL, [URLlien])
1. Bâtir et initialiser le graphe
2. Jusqu’à convergence, recalculer PageRank pour chaque
page web
3. Retourner les K premières valeurs de PageRank (pas
présenté)
mathieu.dumoulin@gmail.com 2014-02-14
Étape 1: Bâtir le graphe
Mapper:
Entrée: une page web
Pour chaque lien de la page, émettre:
clef: URLpage
valeur: URLlien
Reducer:
Entrée:
clef: URLpage
valeurs: [URLlien, …]
Sortie:
clef: URLpage
valeur: «PR;[URLlien]»
mathieu.dumoulin@gmail.com 2014-02-14
Étape 2: calculer PageRank - Map
Mapper:
Entrée:
clef: URLpage
valeur: «PR;[URLlien,…]»
Sortie:
Pour chaque URLlien, émettre:
clef: URLlien
valeur: «URLpage;PR, nb_urllien»
Où: nb_urllien est le compte de URLlien
mathieu.dumoulin@gmail.com 2014-02-14
Étape 2: calculer PageRank - Reduce
Reducer:
Entrée:
clef: URLpage
valeurs: [«URLinverse;PR, nb_urlpage_inverse», …]
Traitement: calculer le PR
Sortie:
clef: URLpage
valeurs: « PR;[URLlien]»
mathieu.dumoulin@gmail.com 2014-02-14
PageRank en MapReduce: Résultats
Notes:
Source: PageRank Calculation using Map Reduce - The Cornell Web Lab (2008)
Résultats obtenus sur une grappe Hadoop de 50 nœuds (Intel Xeon 2.66GHz 16GB ram)
Mon implémentation: https://bitbucket.org/mathieu_dumoulin/pagerank-mr
mathieu.dumoulin@gmail.com 2014-02-14
MapReduce PageRank: Résultats
(8 fois plus de pages que Cornell)
mathieu.dumoulin@gmail.com 2014-02-14
MapReduce PageRank: Résultats
mathieu.dumoulin@gmail.com 2014-02-14
Conclusion (malheureuse)
 MapReduce est une solution puissante au problème de
programmation distribuée
 La plate-forme fait toute la distribution et la gestion des
erreurs
 Le travail de programmation commence par la
formulation d’un algorithme MapReduce
 Ce n’est pas toujours facile
 Trouver et formuler un algorithme performant est relativement
difficile
 Le travail réel de programmation demande une maîtrise (très)
avancée de Java
mathieu.dumoulin@gmail.com 2014-02-14
Conclusion
mathieu.dumoulin@gmail.com 2014-02-14
Conclusion
On n’est pas prisonnier de MapReduce pour utiliser une
grappe Hadoop!
Apache Pig: optimiser les tâches de ETL
Apache Hive: analyser ses données façon SQL
Cascading et Apache Crunch: librairies Java qui simplifient
les opérations difficiles en MapReduce
Apache Mahout: librarie de machine learning qui peut
utiliser une grappe Hadoop « automatiquement »
mathieu.dumoulin@gmail.com 2014-02-14
Questions et commentaires
2014-02-14mathieu.dumoulin@gmail.com
Hadoop est de plus en plus une composante
d’infrastructure « standard » pour le traitement de
donnée à grande échelle et est promis à un bel avenir!
Partie Bonus
2014-02-14mathieu.dumoulin@gmail.com
 MapReduce et Machine Learning
 Exemple
 Algorithme K-Means
Map et Reduce et le machine learning?
Problématique exemple: recherche de paramètres optimaux
Yasser Ganjisaffar,Thomas Debeauvais, Sara Javanmardi, Rich Caruana, and CristinaVideira Lopes. 2011. Distributed tuning of
machine learning algorithms using MapReduce Clusters. In Proceedings of theThirdWorkshop on Large Scale Data Mining:Theory and
Applications(LDMTA '11).ACM, NewYork, NY, USA, ,Article 2 , 8 pages. DOI=10.1145/2002945.2002947
http://doi.acm.org/10.1145/2002945.2002947
mathieu.dumoulin@gmail.com 2014-02-14
Bonus:
Algorithme K-means clustering
 Problème: regrouper des données en K groupes
mathieu.dumoulin@gmail.com 2014-02-14
Algorithme K-means
(Lloyd’s Algorithm)
Initialiser les K centroïdes (d’une certaine façon)
Pour chacune de plusieurs d’itérations:
Pour chaque point:
Assigner au centroïde le plus proche
Selon une mesure de distance (ex: distance Euclidienne)
Pour chaque centroïde:
Recalculer sa position en faisant la moyenne
des membres de son groupe
mathieu.dumoulin@gmail.com 2014-02-14
K-means en MapReduce
 Driver: lancer les itérations
 Combien d’étapes map-reduce?
Une seule!
mathieu.dumoulin@gmail.com 2014-02-14
K-means MapReduce
 Driver: le “main” qui lance les tâches (Job) MapReduce et qui
itère jusqu’à convergence
 Mapper:Assigner chaque point au cluster le plus proche (en
parallèle!)
 Entrée: Key: Null value: vecteur
 Sortie: Key: index du centroïde le plus proche, value: vecteur
 Reducer: Calculer la moyenne des points membre du cluster
(en parallèle!)
 Key:
 Information partagée: les vecteurs des centroïdes
mathieu.dumoulin@gmail.com 2014-02-14
K-Means et MapReduce: État de l’art
Bahman Bahmani, Benjamin Moseley,AndreaVattani, Ravi
Kumar, and SergeiVassilvitskii. 2012. Scalable k-
means++. Proc.VLDB Endow. 5, 7 (March 2012), 622-633.
http://theory.stanford.edu/~sergei/papers/vldb12-kmpar.pdf
Implémenté dans la librairie Apache Mahout
mathieu.dumoulin@gmail.com 2014-02-14

Contenu connexe

Tendances

Présentation Map reduce altnetfr
Présentation Map reduce altnetfrPrésentation Map reduce altnetfr
Présentation Map reduce altnetfraltnetfr
 
Casablanca Hadoop & Big Data Meetup - Introduction à Hadoop
Casablanca Hadoop & Big Data Meetup - Introduction à HadoopCasablanca Hadoop & Big Data Meetup - Introduction à Hadoop
Casablanca Hadoop & Big Data Meetup - Introduction à HadoopBenoît de CHATEAUVIEUX
 
Big Data: Hadoop Map / Reduce sur Windows et Windows Azure
Big Data: Hadoop Map / Reduce sur Windows et Windows AzureBig Data: Hadoop Map / Reduce sur Windows et Windows Azure
Big Data: Hadoop Map / Reduce sur Windows et Windows AzureMicrosoft
 
Cartographie du big data
Cartographie du big dataCartographie du big data
Cartographie du big dataacogoluegnes
 
Stats web avec Hive chez Scoop.it
Stats web avec Hive chez Scoop.itStats web avec Hive chez Scoop.it
Stats web avec Hive chez Scoop.ithibnico
 
Présentation Big Data et REX Hadoop
Présentation Big Data et REX HadoopPrésentation Big Data et REX Hadoop
Présentation Big Data et REX HadoopJoseph Glorieux
 
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...OCTO Technology
 
BigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceBigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceLilia Sfaxi
 
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache Spark
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache SparkPlateforme bigdata orientée BI avec Hortoworks Data Platform et Apache Spark
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache SparkALTIC Altic
 
Hadoop and friends : introduction
Hadoop and friends : introductionHadoop and friends : introduction
Hadoop and friends : introductionfredcons
 
BigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherBigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherLilia Sfaxi
 
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnels
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnelsUSI 2013 : 7 changements nécessaires pour sauver vos SI décisionnels
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnelsJoseph Glorieux
 
HUG France - 20160114 industrialisation_process_big_data CanalPlus
HUG France -  20160114 industrialisation_process_big_data CanalPlusHUG France -  20160114 industrialisation_process_big_data CanalPlus
HUG France - 20160114 industrialisation_process_big_data CanalPlusModern Data Stack France
 
Big Data, Hadoop & Spark
Big Data, Hadoop & SparkBig Data, Hadoop & Spark
Big Data, Hadoop & SparkAlexia Audevart
 
Hadoop Hbase - Introduction
Hadoop Hbase - IntroductionHadoop Hbase - Introduction
Hadoop Hbase - IntroductionBlandine Larbret
 
BigData_TP1: Initiation à Hadoop et Map-Reduce
BigData_TP1: Initiation à Hadoop et Map-ReduceBigData_TP1: Initiation à Hadoop et Map-Reduce
BigData_TP1: Initiation à Hadoop et Map-ReduceLilia Sfaxi
 
Les technologies big data avec speech commentaries
Les technologies big data avec speech commentariesLes technologies big data avec speech commentaries
Les technologies big data avec speech commentariesRima Jamli Faidi
 

Tendances (20)

Présentation Map reduce altnetfr
Présentation Map reduce altnetfrPrésentation Map reduce altnetfr
Présentation Map reduce altnetfr
 
Casablanca Hadoop & Big Data Meetup - Introduction à Hadoop
Casablanca Hadoop & Big Data Meetup - Introduction à HadoopCasablanca Hadoop & Big Data Meetup - Introduction à Hadoop
Casablanca Hadoop & Big Data Meetup - Introduction à Hadoop
 
HADOOP + R
HADOOP + RHADOOP + R
HADOOP + R
 
Big Data: Hadoop Map / Reduce sur Windows et Windows Azure
Big Data: Hadoop Map / Reduce sur Windows et Windows AzureBig Data: Hadoop Map / Reduce sur Windows et Windows Azure
Big Data: Hadoop Map / Reduce sur Windows et Windows Azure
 
Cartographie du big data
Cartographie du big dataCartographie du big data
Cartographie du big data
 
Stats web avec Hive chez Scoop.it
Stats web avec Hive chez Scoop.itStats web avec Hive chez Scoop.it
Stats web avec Hive chez Scoop.it
 
Hadoop
HadoopHadoop
Hadoop
 
Présentation Big Data et REX Hadoop
Présentation Big Data et REX HadoopPrésentation Big Data et REX Hadoop
Présentation Big Data et REX Hadoop
 
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...
Softshake 2013 - Yarn dans la vraie vie, retour d'expérience et bonnes pratiq...
 
BigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-ReduceBigData_Chp2: Hadoop & Map-Reduce
BigData_Chp2: Hadoop & Map-Reduce
 
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache Spark
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache SparkPlateforme bigdata orientée BI avec Hortoworks Data Platform et Apache Spark
Plateforme bigdata orientée BI avec Hortoworks Data Platform et Apache Spark
 
Hadoop and friends : introduction
Hadoop and friends : introductionHadoop and friends : introduction
Hadoop and friends : introduction
 
Tech day hadoop, Spark
Tech day hadoop, SparkTech day hadoop, Spark
Tech day hadoop, Spark
 
BigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherBigData_Chp5: Putting it all together
BigData_Chp5: Putting it all together
 
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnels
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnelsUSI 2013 : 7 changements nécessaires pour sauver vos SI décisionnels
USI 2013 : 7 changements nécessaires pour sauver vos SI décisionnels
 
HUG France - 20160114 industrialisation_process_big_data CanalPlus
HUG France -  20160114 industrialisation_process_big_data CanalPlusHUG France -  20160114 industrialisation_process_big_data CanalPlus
HUG France - 20160114 industrialisation_process_big_data CanalPlus
 
Big Data, Hadoop & Spark
Big Data, Hadoop & SparkBig Data, Hadoop & Spark
Big Data, Hadoop & Spark
 
Hadoop Hbase - Introduction
Hadoop Hbase - IntroductionHadoop Hbase - Introduction
Hadoop Hbase - Introduction
 
BigData_TP1: Initiation à Hadoop et Map-Reduce
BigData_TP1: Initiation à Hadoop et Map-ReduceBigData_TP1: Initiation à Hadoop et Map-Reduce
BigData_TP1: Initiation à Hadoop et Map-Reduce
 
Les technologies big data avec speech commentaries
Les technologies big data avec speech commentariesLes technologies big data avec speech commentaries
Les technologies big data avec speech commentaries
 

En vedette

MapReduce au Niveau RP*
MapReduce au Niveau RP*MapReduce au Niveau RP*
MapReduce au Niveau RP*UHBC
 
Flexible In-Situ Indexing for Hadoop via Elephant Twin
Flexible In-Situ Indexing for Hadoop via Elephant TwinFlexible In-Situ Indexing for Hadoop via Elephant Twin
Flexible In-Situ Indexing for Hadoop via Elephant TwinDmitriy Ryaboy
 
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012Integrating Hadoop Into the Enterprise – Hadoop Summit 2012
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012Jonathan Seidman
 
IBM Big Data Analytics Concepts and Use Cases
IBM Big Data Analytics Concepts and Use CasesIBM Big Data Analytics Concepts and Use Cases
IBM Big Data Analytics Concepts and Use CasesTony Pearson
 
BigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans HadoopBigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans HadoopLilia Sfaxi
 
BigData_TP3 : Spark
BigData_TP3 : SparkBigData_TP3 : Spark
BigData_TP3 : SparkLilia Sfaxi
 
BigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingBigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingLilia Sfaxi
 
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...Cynthia Saracco
 
BigData_Chp1: Introduction à la Big Data
BigData_Chp1: Introduction à la Big DataBigData_Chp1: Introduction à la Big Data
BigData_Chp1: Introduction à la Big DataLilia Sfaxi
 
Overview - IBM Big Data Platform
Overview - IBM Big Data PlatformOverview - IBM Big Data Platform
Overview - IBM Big Data PlatformVikas Manoria
 
Big Data & Analytics Architecture
Big Data & Analytics ArchitectureBig Data & Analytics Architecture
Big Data & Analytics ArchitectureArvind Sathi
 
IBM Watson Analytics Presentation
IBM Watson Analytics PresentationIBM Watson Analytics Presentation
IBM Watson Analytics PresentationIan Balina
 
Big Data: SQL on Hadoop from IBM
Big Data:  SQL on Hadoop from IBM Big Data:  SQL on Hadoop from IBM
Big Data: SQL on Hadoop from IBM Cynthia Saracco
 
Fr les lunnettesgema
Fr les lunnettesgemaFr les lunnettesgema
Fr les lunnettesgemaDidacticolite
 
Frengjisht pr i gatimit
Frengjisht pr i gatimitFrengjisht pr i gatimit
Frengjisht pr i gatimithelloat
 
Cm6.08 part3 protection_innovation_benoit_tech
Cm6.08 part3 protection_innovation_benoit_techCm6.08 part3 protection_innovation_benoit_tech
Cm6.08 part3 protection_innovation_benoit_techidigroupe6
 
Offre Eventeam Tournoi des 6 nations 2013 : France - Ecosse
Offre Eventeam Tournoi des 6 nations 2013 : France - EcosseOffre Eventeam Tournoi des 6 nations 2013 : France - Ecosse
Offre Eventeam Tournoi des 6 nations 2013 : France - EcosseEventeam
 

En vedette (20)

MapReduce au Niveau RP*
MapReduce au Niveau RP*MapReduce au Niveau RP*
MapReduce au Niveau RP*
 
Flexible In-Situ Indexing for Hadoop via Elephant Twin
Flexible In-Situ Indexing for Hadoop via Elephant TwinFlexible In-Situ Indexing for Hadoop via Elephant Twin
Flexible In-Situ Indexing for Hadoop via Elephant Twin
 
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012Integrating Hadoop Into the Enterprise – Hadoop Summit 2012
Integrating Hadoop Into the Enterprise – Hadoop Summit 2012
 
IBM Big Data Analytics Concepts and Use Cases
IBM Big Data Analytics Concepts and Use CasesIBM Big Data Analytics Concepts and Use Cases
IBM Big Data Analytics Concepts and Use Cases
 
BigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans HadoopBigData_TP2: Design Patterns dans Hadoop
BigData_TP2: Design Patterns dans Hadoop
 
Intro to Apache Mahout
Intro to Apache MahoutIntro to Apache Mahout
Intro to Apache Mahout
 
BigData_TP3 : Spark
BigData_TP3 : SparkBigData_TP3 : Spark
BigData_TP3 : Spark
 
BigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingBigData_Chp3: Data Processing
BigData_Chp3: Data Processing
 
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...
Big Data: Introducing BigInsights, IBM's Hadoop- and Spark-based analytical p...
 
BigData_Chp1: Introduction à la Big Data
BigData_Chp1: Introduction à la Big DataBigData_Chp1: Introduction à la Big Data
BigData_Chp1: Introduction à la Big Data
 
Overview - IBM Big Data Platform
Overview - IBM Big Data PlatformOverview - IBM Big Data Platform
Overview - IBM Big Data Platform
 
Big Data & Analytics Architecture
Big Data & Analytics ArchitectureBig Data & Analytics Architecture
Big Data & Analytics Architecture
 
IBM Watson Analytics Presentation
IBM Watson Analytics PresentationIBM Watson Analytics Presentation
IBM Watson Analytics Presentation
 
Big Data: SQL on Hadoop from IBM
Big Data:  SQL on Hadoop from IBM Big Data:  SQL on Hadoop from IBM
Big Data: SQL on Hadoop from IBM
 
Fr les lunnettesgema
Fr les lunnettesgemaFr les lunnettesgema
Fr les lunnettesgema
 
Frengjisht pr i gatimit
Frengjisht pr i gatimitFrengjisht pr i gatimit
Frengjisht pr i gatimit
 
Cm6.08 part3 protection_innovation_benoit_tech
Cm6.08 part3 protection_innovation_benoit_techCm6.08 part3 protection_innovation_benoit_tech
Cm6.08 part3 protection_innovation_benoit_tech
 
Frances ufpe 2013
Frances ufpe 2013Frances ufpe 2013
Frances ufpe 2013
 
Decret pétards
Decret pétardsDecret pétards
Decret pétards
 
Offre Eventeam Tournoi des 6 nations 2013 : France - Ecosse
Offre Eventeam Tournoi des 6 nations 2013 : France - EcosseOffre Eventeam Tournoi des 6 nations 2013 : France - Ecosse
Offre Eventeam Tournoi des 6 nations 2013 : France - Ecosse
 

Similaire à Introduction aux algorithmes map reduce

Spad big data - sfds - 2016
Spad   big data - sfds - 2016Spad   big data - sfds - 2016
Spad big data - sfds - 2016Julien BLAIZE
 
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...Hadjer BENHADJ DJILALI
 
Bluestone - Panorama des solutions analytiques existantes
Bluestone - Panorama des solutions analytiques existantesBluestone - Panorama des solutions analytiques existantes
Bluestone - Panorama des solutions analytiques existantesBluestoneServices
 
Prometheus & Grafana - Probing and Alerting
Prometheus & Grafana - Probing and AlertingPrometheus & Grafana - Probing and Alerting
Prometheus & Grafana - Probing and AlertingDolead Engineering
 
Looker Studio - trucs et astuces pour améliorer ses dashboards
Looker Studio - trucs et astuces pour améliorer ses dashboardsLooker Studio - trucs et astuces pour améliorer ses dashboards
Looker Studio - trucs et astuces pour améliorer ses dashboardsMadeline Pinthon
 
D’un modèle d'IA dans un notebook à un service temps réel : architecturons !
D’un modèle d'IA dans un notebook à un service temps réel : architecturons ! D’un modèle d'IA dans un notebook à un service temps réel : architecturons !
D’un modèle d'IA dans un notebook à un service temps réel : architecturons ! Marie-Alice Blete
 
Techday Arrow Group: Hadoop & le Big Data
Techday Arrow Group: Hadoop & le Big DataTechday Arrow Group: Hadoop & le Big Data
Techday Arrow Group: Hadoop & le Big DataArrow Group
 
La classification des Emails utilisant le modèle MapReduce
La classification des Emails utilisant le modèle MapReduce La classification des Emails utilisant le modèle MapReduce
La classification des Emails utilisant le modèle MapReduce Nour El Houda Megherbi
 
Construire un data lake managé - GDG Paris - Juin 2019
Construire un data lake managé - GDG Paris - Juin 2019Construire un data lake managé - GDG Paris - Juin 2019
Construire un data lake managé - GDG Paris - Juin 2019Jean-Baptiste Claramonte
 
P8 03 presentation
P8 03 presentationP8 03 presentation
P8 03 presentationrajiasellami
 
Offrir de l'analytique en temps réel en un clic
Offrir de l'analytique en temps réel en un clicOffrir de l'analytique en temps réel en un clic
Offrir de l'analytique en temps réel en un clicJean-Michel Franco
 
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp012014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01MongoDB
 
Stratégies d’optimisation de requêtes SQL dans un écosystème Hadoop
Stratégies d’optimisation de requêtes SQL dans un écosystème HadoopStratégies d’optimisation de requêtes SQL dans un écosystème Hadoop
Stratégies d’optimisation de requêtes SQL dans un écosystème HadoopSébastien Frackowiak
 
Bases de Données non relationnelles, NoSQL (Introduction) 1er cours
Bases de Données non relationnelles, NoSQL (Introduction) 1er coursBases de Données non relationnelles, NoSQL (Introduction) 1er cours
Bases de Données non relationnelles, NoSQL (Introduction) 1er coursHatim CHAHDI
 
Cas de la refonte de STM.info
Cas de la refonte de STM.infoCas de la refonte de STM.info
Cas de la refonte de STM.infoTP1
 

Similaire à Introduction aux algorithmes map reduce (20)

Presentation Map Reduce
Presentation Map ReducePresentation Map Reduce
Presentation Map Reduce
 
Spad big data - sfds - 2016
Spad   big data - sfds - 2016Spad   big data - sfds - 2016
Spad big data - sfds - 2016
 
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...
Parallélisation d'algorithmes de graphes avec MapReduce sur un cluster d'ordi...
 
Bluestone - Panorama des solutions analytiques existantes
Bluestone - Panorama des solutions analytiques existantesBluestone - Panorama des solutions analytiques existantes
Bluestone - Panorama des solutions analytiques existantes
 
Prometheus & Grafana - Probing and Alerting
Prometheus & Grafana - Probing and AlertingPrometheus & Grafana - Probing and Alerting
Prometheus & Grafana - Probing and Alerting
 
Looker Studio - trucs et astuces pour améliorer ses dashboards
Looker Studio - trucs et astuces pour améliorer ses dashboardsLooker Studio - trucs et astuces pour améliorer ses dashboards
Looker Studio - trucs et astuces pour améliorer ses dashboards
 
Big data
Big dataBig data
Big data
 
D’un modèle d'IA dans un notebook à un service temps réel : architecturons !
D’un modèle d'IA dans un notebook à un service temps réel : architecturons ! D’un modèle d'IA dans un notebook à un service temps réel : architecturons !
D’un modèle d'IA dans un notebook à un service temps réel : architecturons !
 
Techday Arrow Group: Hadoop & le Big Data
Techday Arrow Group: Hadoop & le Big DataTechday Arrow Group: Hadoop & le Big Data
Techday Arrow Group: Hadoop & le Big Data
 
OWF12/BIG DATA OWF OpenSearchServer light
OWF12/BIG DATA OWF OpenSearchServer lightOWF12/BIG DATA OWF OpenSearchServer light
OWF12/BIG DATA OWF OpenSearchServer light
 
Quel hadoop (#quelhadoop)
Quel hadoop (#quelhadoop)Quel hadoop (#quelhadoop)
Quel hadoop (#quelhadoop)
 
La classification des Emails utilisant le modèle MapReduce
La classification des Emails utilisant le modèle MapReduce La classification des Emails utilisant le modèle MapReduce
La classification des Emails utilisant le modèle MapReduce
 
Construire un data lake managé - GDG Paris - Juin 2019
Construire un data lake managé - GDG Paris - Juin 2019Construire un data lake managé - GDG Paris - Juin 2019
Construire un data lake managé - GDG Paris - Juin 2019
 
P8 03 presentation
P8 03 presentationP8 03 presentation
P8 03 presentation
 
CV2016
CV2016CV2016
CV2016
 
Offrir de l'analytique en temps réel en un clic
Offrir de l'analytique en temps réel en un clicOffrir de l'analytique en temps réel en un clic
Offrir de l'analytique en temps réel en un clic
 
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp012014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
2014 03-26-appdevseries-session3-interactingwiththedatabase-fr-phpapp01
 
Stratégies d’optimisation de requêtes SQL dans un écosystème Hadoop
Stratégies d’optimisation de requêtes SQL dans un écosystème HadoopStratégies d’optimisation de requêtes SQL dans un écosystème Hadoop
Stratégies d’optimisation de requêtes SQL dans un écosystème Hadoop
 
Bases de Données non relationnelles, NoSQL (Introduction) 1er cours
Bases de Données non relationnelles, NoSQL (Introduction) 1er coursBases de Données non relationnelles, NoSQL (Introduction) 1er cours
Bases de Données non relationnelles, NoSQL (Introduction) 1er cours
 
Cas de la refonte de STM.info
Cas de la refonte de STM.infoCas de la refonte de STM.info
Cas de la refonte de STM.info
 

Plus de Mathieu Dumoulin

Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...
Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...
Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...Mathieu Dumoulin
 
State of the Art Robot Predictive Maintenance with Real-time Sensor Data
State of the Art Robot Predictive Maintenance with Real-time Sensor DataState of the Art Robot Predictive Maintenance with Real-time Sensor Data
State of the Art Robot Predictive Maintenance with Real-time Sensor DataMathieu Dumoulin
 
MapR and Machine Learning Primer
MapR and Machine Learning PrimerMapR and Machine Learning Primer
MapR and Machine Learning PrimerMathieu Dumoulin
 
CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016Mathieu Dumoulin
 
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...Mathieu Dumoulin
 
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...Mathieu Dumoulin
 
Distributed Deep Learning on Spark
Distributed Deep Learning on SparkDistributed Deep Learning on Spark
Distributed Deep Learning on SparkMathieu Dumoulin
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comMathieu Dumoulin
 

Plus de Mathieu Dumoulin (8)

Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...
Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...
Converged and Containerized Distributed Deep Learning With TensorFlow and Kub...
 
State of the Art Robot Predictive Maintenance with Real-time Sensor Data
State of the Art Robot Predictive Maintenance with Real-time Sensor DataState of the Art Robot Predictive Maintenance with Real-time Sensor Data
State of the Art Robot Predictive Maintenance with Real-time Sensor Data
 
MapR and Machine Learning Primer
MapR and Machine Learning PrimerMapR and Machine Learning Primer
MapR and Machine Learning Primer
 
CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016
 
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...
Streaming Architecture to Connect Everything (Including Hybrid Cloud) - Strat...
 
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...
Real-World Machine Learning - Leverage the Features of MapR Converged Data Pl...
 
Distributed Deep Learning on Spark
Distributed Deep Learning on SparkDistributed Deep Learning on Spark
Distributed Deep Learning on Spark
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.com
 

Introduction aux algorithmes map reduce

  • 1. Introduction aux algorithmes MapReduce Mathieu Dumoulin (GRAAL), 14 Février 2014
  • 2. Plan  Introduction de la problématique  Tutoriel MapReduce  Design d’algorithmes MapReduce  Tri, somme et calcul de moyenne  PageRank en MapReduce  Conclusion mathieu.dumoulin@gmail.com 2014-02-14
  • 3. « Big Data » Building new analytic applications based on new types of data, in order to better serve your customers and drive a better competitive advantage - David McJannet, Hortonworks Big data is high volume, high velocity, and/or high variety information assets that require new forms of processing to enable enhanced decision making, insight discovery and process optimization - Gartner, updated definition of big data (2012) mathieu.dumoulin@gmail.com 2014-02-14
  • 4. Un outil spécialisé Problèmes où Hadoop est envisageable:  Trop de données (GB,TB,PB)  Améliorer des résultats existants  Obtenir de nouveaux résultats  Combiner des données hétérogènes  Croissance rapide (et constante) des données  Temps de traitement lent (minutes, heures)  Budgets limités  Plusieurs ordinateurs déjà disponibles mathieu.dumoulin@gmail.com 2014-02-14
  • 5. Hadoop au cœur du big data mathieu.dumoulin@gmail.com 2014-02-14
  • 6. MapReduce au cœur de Hadoop Hadoop MapReduce is a software framework for easily writing applications which process vast amounts of data (multi-terabyte data-sets) in-parallel on large clusters (thousands of nodes) of commodity hardware in a reliable, fault-tolerant manner. - Hadoop Tutorial, hadoop.apache.org mathieu.dumoulin@gmail.com 2014-02-14
  • 7. Gain d’utiliser Hadoop?  Tout le travail de distribution, balancement de charge, synchronisation et de gestion d’erreur est géré automatiquement  Il suffit de programmer Map et Reduce (Java, C++, Python, bash, etc.)  Une grappe Hadoop peut évoluer facilement en ajoutant des nœuds en tout temps  Hadoop offre un rapport performance-prix très compétitif (Amazon EMS, réutilisation de PC existants, aucun coûts de licences ni de matériel spécialisé HPC) mathieu.dumoulin@gmail.com 2014-02-14
  • 8. L’exemple WordCount On veut trouver les k mots les plus fréquents dans une collection de textes. def word_count(text, k): counts = defaultdict(int) for word in text.split(): counts[word.lower()] += 1 return sorted(counts, key=counts.get, reverse=True)[:k] Mais cette solution est-elle la bonne si le texte est très grand? Et s’il est très, très, …, très grand? mathieu.dumoulin@gmail.com 2014-02-14
  • 9. La taille en soit peut être un problème Problème SolutionTaille • 100M mots • 1000M mots • 100MM mots • 1000MM mots • Plus encore! • Pas de problèmes • Mémoire insuffisante • Processeur insuffisant • 1 ordinateur insuffisant • Réseau insuffisant, contrôleur surchargé • Naïve avec 1 seul ordinateur • Utiliser le disque, Fenêtre glissante • Multithreading, éliminer < N • Distribuer le calcul • MapReduce (ou solution du même ordre comme MPI, etc.) mathieu.dumoulin@gmail.com 2014-02-14
  • 11. Map et Reduce: la paire Clef-Valeur Mapper: (K,V) → (K’, V’) Reducer: (K’, [V’, V’,…]) → (K’’, V’’) Données (HDFS) Données’ (HDFS) mathieu.dumoulin@gmail.com 2014-02-14
  • 12. MapReduce en action: WordCount illustré mathieu.dumoulin@gmail.com 2014-02-14
  • 13. Map et Reduce: Shuffle and Sort Source: Data Intensive Text Processing with MapReduce, Jimmy Lin and Chris Dyer, 2010 mathieu.dumoulin@gmail.com 2014-02-14
  • 14. Map et Reduce (moins simplifié)  Les vrai opérateurs:  Mapper  Combiner  Partitioner  Reducer mathieu.dumoulin@gmail.com 2014-02-14
  • 15. Design d’algorithmes pour MapReduce 1- Il faut reformuler les algorithmes en fonctionnel: 2- La bande passante du réseau est une ressource limitée à optimiser: mathieu.dumoulin@gmail.com 2014-02-14
  • 16. Exemples choisis  Exemples simples:  Tri  Somme  Moyenne  Un exemple complet: PageRank  Bonus: K-Means (Lloyd’s algorithm) mathieu.dumoulin@gmail.com 2014-02-14
  • 17. Trier en MapReduce  Propriété du réducteur: les paires sont traitée dans l’ordre (selon la clef), les réducteurs sont aussi dans l’ordre Mapper: Émettre l’élément à trier comme nouvelle clef Reducer: Aucun (i.e. fonction identité) mathieu.dumoulin@gmail.com 2014-02-14
  • 18. Calcul d’une somme (WordCount) mathieu.dumoulin@gmail.com 2014-02-14
  • 20. Calcul de moyenne Utiliser un combiner est il approprié? Si on reprend le reducer comme combiner, l’algorithme est-il encore correct?mathieu.dumoulin@gmail.com 2014-02-14
  • 21. Comment améliorer ce calcul? mathieu.dumoulin@gmail.com 2014-02-14
  • 22. Design d’une solution MapReduce pour l’algorithme PageRank mathieu.dumoulin@gmail.com 2014-02-14
  • 23. Qu’est-ce que PageRank? Distribution de probabilité sur les pages web qui représente la chance qu’un utilisateur naviguant au hasard arrive à une page web particulière. Notes:  Le web est un graphe orienté, une page est un nœud et les hyperliens sont des arcs.  L’algorithme recalcule la probabilité de toutes les pages itérativement jusqu’à convergence mathieu.dumoulin@gmail.com 2014-02-14
  • 24. Comment calculer PageRank (simplifié) 𝑃𝑅 𝑝𝑖 = 𝑝 𝑖∈𝑀(𝑝 𝑖) 𝑃𝑅(𝑝𝑗) 𝐿(𝑝𝑗) • p1,p2,…,pN sont les pages web (les nœuds du graphe) • M(pi) est l’ensemble des pages ayant un lien vers pi • L(pj) est le nombre de liens sortant de la page pj • N est le nombre total de pages web Note: Pour simplifier, on élimine le facteur d’atténuation, paramétrisé par la probabilité que l’utilisateur arrête de naviguer. Page, Lawrence and Brin, Sergey and Motwani, Rajeev and Winograd, Terry (1999) The PageRank Citation Ranking: Bringing Order to theWeb. Technical Report. Stanford InfoLab. mathieu.dumoulin@gmail.com 2014-02-14
  • 25. PageRank par un exemple Le web a trois pages web:A, B et C Initialisation: PR(A) = PR(B) = PR(C) = 0.33 Jusqu’à convergence: 𝑃𝑅 𝐴 = 𝑃𝑅(𝐵) 2 𝑃𝑅 𝐵 = 𝑃𝑅(𝐴) 2 𝑃𝑅 𝐶 = 𝑃𝑅(𝐴) 2 + 𝑃𝑅(𝐵) 2 mathieu.dumoulin@gmail.com 2014-02-14
  • 26. PageRank en MapReduce Donnés de départ: collection de pages web (URL, [URLlien]) 1. Bâtir et initialiser le graphe 2. Jusqu’à convergence, recalculer PageRank pour chaque page web 3. Retourner les K premières valeurs de PageRank (pas présenté) mathieu.dumoulin@gmail.com 2014-02-14
  • 27. Étape 1: Bâtir le graphe Mapper: Entrée: une page web Pour chaque lien de la page, émettre: clef: URLpage valeur: URLlien Reducer: Entrée: clef: URLpage valeurs: [URLlien, …] Sortie: clef: URLpage valeur: «PR;[URLlien]» mathieu.dumoulin@gmail.com 2014-02-14
  • 28. Étape 2: calculer PageRank - Map Mapper: Entrée: clef: URLpage valeur: «PR;[URLlien,…]» Sortie: Pour chaque URLlien, émettre: clef: URLlien valeur: «URLpage;PR, nb_urllien» Où: nb_urllien est le compte de URLlien mathieu.dumoulin@gmail.com 2014-02-14
  • 29. Étape 2: calculer PageRank - Reduce Reducer: Entrée: clef: URLpage valeurs: [«URLinverse;PR, nb_urlpage_inverse», …] Traitement: calculer le PR Sortie: clef: URLpage valeurs: « PR;[URLlien]» mathieu.dumoulin@gmail.com 2014-02-14
  • 30. PageRank en MapReduce: Résultats Notes: Source: PageRank Calculation using Map Reduce - The Cornell Web Lab (2008) Résultats obtenus sur une grappe Hadoop de 50 nœuds (Intel Xeon 2.66GHz 16GB ram) Mon implémentation: https://bitbucket.org/mathieu_dumoulin/pagerank-mr mathieu.dumoulin@gmail.com 2014-02-14
  • 31. MapReduce PageRank: Résultats (8 fois plus de pages que Cornell) mathieu.dumoulin@gmail.com 2014-02-14
  • 33. Conclusion (malheureuse)  MapReduce est une solution puissante au problème de programmation distribuée  La plate-forme fait toute la distribution et la gestion des erreurs  Le travail de programmation commence par la formulation d’un algorithme MapReduce  Ce n’est pas toujours facile  Trouver et formuler un algorithme performant est relativement difficile  Le travail réel de programmation demande une maîtrise (très) avancée de Java mathieu.dumoulin@gmail.com 2014-02-14
  • 35. Conclusion On n’est pas prisonnier de MapReduce pour utiliser une grappe Hadoop! Apache Pig: optimiser les tâches de ETL Apache Hive: analyser ses données façon SQL Cascading et Apache Crunch: librairies Java qui simplifient les opérations difficiles en MapReduce Apache Mahout: librarie de machine learning qui peut utiliser une grappe Hadoop « automatiquement » mathieu.dumoulin@gmail.com 2014-02-14
  • 36. Questions et commentaires 2014-02-14mathieu.dumoulin@gmail.com Hadoop est de plus en plus une composante d’infrastructure « standard » pour le traitement de donnée à grande échelle et est promis à un bel avenir!
  • 37. Partie Bonus 2014-02-14mathieu.dumoulin@gmail.com  MapReduce et Machine Learning  Exemple  Algorithme K-Means
  • 38. Map et Reduce et le machine learning? Problématique exemple: recherche de paramètres optimaux Yasser Ganjisaffar,Thomas Debeauvais, Sara Javanmardi, Rich Caruana, and CristinaVideira Lopes. 2011. Distributed tuning of machine learning algorithms using MapReduce Clusters. In Proceedings of theThirdWorkshop on Large Scale Data Mining:Theory and Applications(LDMTA '11).ACM, NewYork, NY, USA, ,Article 2 , 8 pages. DOI=10.1145/2002945.2002947 http://doi.acm.org/10.1145/2002945.2002947 mathieu.dumoulin@gmail.com 2014-02-14
  • 39. Bonus: Algorithme K-means clustering  Problème: regrouper des données en K groupes mathieu.dumoulin@gmail.com 2014-02-14
  • 40. Algorithme K-means (Lloyd’s Algorithm) Initialiser les K centroïdes (d’une certaine façon) Pour chacune de plusieurs d’itérations: Pour chaque point: Assigner au centroïde le plus proche Selon une mesure de distance (ex: distance Euclidienne) Pour chaque centroïde: Recalculer sa position en faisant la moyenne des membres de son groupe mathieu.dumoulin@gmail.com 2014-02-14
  • 41. K-means en MapReduce  Driver: lancer les itérations  Combien d’étapes map-reduce? Une seule! mathieu.dumoulin@gmail.com 2014-02-14
  • 42. K-means MapReduce  Driver: le “main” qui lance les tâches (Job) MapReduce et qui itère jusqu’à convergence  Mapper:Assigner chaque point au cluster le plus proche (en parallèle!)  Entrée: Key: Null value: vecteur  Sortie: Key: index du centroïde le plus proche, value: vecteur  Reducer: Calculer la moyenne des points membre du cluster (en parallèle!)  Key:  Information partagée: les vecteurs des centroïdes mathieu.dumoulin@gmail.com 2014-02-14
  • 43. K-Means et MapReduce: État de l’art Bahman Bahmani, Benjamin Moseley,AndreaVattani, Ravi Kumar, and SergeiVassilvitskii. 2012. Scalable k- means++. Proc.VLDB Endow. 5, 7 (March 2012), 622-633. http://theory.stanford.edu/~sergei/papers/vldb12-kmpar.pdf Implémenté dans la librairie Apache Mahout mathieu.dumoulin@gmail.com 2014-02-14