


Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!



Data science is the study of data to extract meaningful insights for business. It is a multidisciplinary approach that combines principles and practices from the fields of mathematics, statistics, artificial intelligence, and computer engineering to analyze large amounts of data.
The web is full of “data-driven apps.” --> This is not data science - almost any e-commerce application is a data-driven application - Amazon ad esempio lo usa in tal modo, ma usa anche i dati per effettuare l'analisi dei prodotti che potrebbero interessarti dopo un determinato acquisto(in questo caso e' data science.)
Example: Gracenote built a database of track lengths, and coupled it to a database of album metadata (track titles, artists, album titles). This is used by applications as iTunes
In the past Special purpose parallel computers with many processors and specialized hardware , Architectures using «super-computers»
Today , Installations with thousands of nodes operating (more or less) independently, Architectures «computer clusters»
Il master node ha la mappa di dove sono starati i dati
Files are divided into chunks , chunks replicated at different compute nodes the nodes holding copies chunks should be located on different racks the chunk size and the degree of replication decided by the user
The master node is itself replicated
il map reduce: Sequentially read large amount of data. Map reduce ha due op fondamentali una op di map e una di reduce:
Map Extracting something of interest Group by key Sort and shuffle Reduce Aggregate, summarize, filter, transform Write the results
Molte vole nel map review e' fittizio mettere la chiave valore
Inseriso il tutto dentro un mapper, otteniamo una coppia chiave valore per ogni vocabolo del documento. Abbiamo n documenti(o n chunks), n macchine e mettiamo un mapper per ogni documento(chunk di dati), otteniamo alla fine n risultati in parallelo. Ottengo poi un cappia chiave valore nuovo, in questo caso ogni valore avra tutte le chiavi dove appare quel valore Funziona questo approccio oerche i mapper possono essere distribuiti, ogni mapper va a Gnerare Un risultato Che viene mantenuto nella macchina dove gira il mapper, ogni singolo risultato si trova in locale quindi.
Il master node pero deve gestire il tutto , difatti chiede alle varie macchine chi ha dei "non" ,ad esempio,di inviarli a vari nodi, ad esempio ad un nodo x invieremo [non(1,1)] da una macchina y1 e così faranno gli y2 , y3 ... tale NoDo fara poi uno shaffle e contera' tali dati. Se ad esmpio il "non" e' presente molte volte , il master decide che il conteggio deve essere fatto in locale, il trasferimento deI Dati e' la parte costosa in questo processo.
Dal punto di vista software: Il mapper può essere messo per ogni chunck , per ogni pozione del testo
Master node takes care of coordination: Task status: (idle, in-progress, completed) Idle tasks get scheduled as workers become available When a map task completes, it sends the master the location and sizes of its R intermediate files, one for each reducer Master pushes this info to reducers Master pings workers periodically to detect failures
Map worker failure - Map tasks completed or in-progress at worker are reset to idle - Reduce workers are notified when task is rescheduled on another worker - Reduce worker failure - Only in-progress tasks are reset to idle - Reduce task is restarted - Master failure - MapReduce task is aborted and client is notified
Combiners:
L'operazione di riducer viene fatta anche dal mapper, viene quindi fatta una somma anche nel mapper, il riducer viene messo in locale, ad esempio un riducer di "non" presente sulla macchina uno, mapper 1, prende tutti i non presenti sul map-per 1 e 2, la stessa cosa in altri casi, ci per mette di trasmettere meno dati e di essere più veloci
Per ridurre il volume dei dati trasmessi tra i mapper e i reducer, si può introdurre un "Combiner" nella fase di Map. Il Combiner agisce come un mini-reducer locale che esegue un'operazione di aggregazione sui dati intermedi direttamente sul nodo del mapper, riducendo così il numero di coppie chiave-valore che devono essere inviate ai reducer.
compongono. Ciò include i costi associati a ogni passaggio di dati tra i diversi task, come i dati in ingresso ai mapper, i dati intermedi ai reducer, e così via. Ignorare il Tempo di Esecuzione : Quando si calcola il costo di comunicazione, il tempo di esecuzione di ogni task non è considerato. Il focus è sulla quantità di dati trasferiti piuttosto che su quanto tempo ci vuole per elaborarli.
The reducer size (q) is the upper bound on the number of values that are allowed to appear in the list associated with a single key.
The replication rate (r) is the number of key-value pairs produced by all the Map tasks on all the inputs, divided by the number of inputs - pNUmero di coppie chiave valore che un input mi genera. There is a tradeoff between r and q, that can be expressed as qr >= 2n^2.
Solution : Divide the images into g groups, reducing the number of comparisons by only comparing images between different groups. MAP Function : For each image, produce g - 1 key-value pairs, where the key represents a group-to-group comparison, and the value is the image itself. REDUCE Function : Each reducer receives the images from two groups (u, v) and compares each image from group u with each image from group v. This avoids redundant comparisons within the same group. Complexity : By using this grouping method, the replication rate r becomes g - 1 and the reducer size q becomes 2 × 10^6/g. Example : With g = 1000, the reducer size is approximately 2GB, and the total data communicated is drastically reduced to about 10^15 bytes, which is 1000 times less than the initial naive approach.