Big Data Analytics - Esplorazione dei dati

Exploratory data analysisè un concetto sviluppato da John Tuckey (1977) che consiste in una nuova prospettiva della statistica. L'idea di Tuckey era che nelle statistiche tradizionali, i dati non venivano esplorati graficamente, venivano usati solo per testare ipotesi. Il primo tentativo di sviluppare uno strumento è stato fatto a Stanford, il progetto si chiamava prim9 . Lo strumento è stato in grado di visualizzare i dati in nove dimensioni, quindi è stato in grado di fornire una prospettiva multivariata dei dati.

Negli ultimi giorni, l'analisi esplorativa dei dati è un must ed è stata inclusa nel ciclo di vita dell'analisi dei big data. La capacità di trovare informazioni ed essere in grado di comunicarle in modo efficace in un'organizzazione è alimentata da forti capacità EDA.

Sulla base delle idee di Tuckey, Bell Labs ha sviluppato il file S programming languageal fine di fornire un'interfaccia interattiva per fare statistiche. L'idea di S era quella di fornire ampie capacità grafiche con un linguaggio facile da usare. Nel mondo di oggi, nel contesto dei Big Data,R che si basa su S il linguaggio di programmazione è il software più popolare per l'analisi.

Il seguente programma dimostra l'uso dell'analisi esplorativa dei dati.

Quello che segue è un esempio di analisi esplorativa dei dati. Questo codice è disponibile anche inpart1/eda/exploratory_data_analysis.R file.

library(nycflights13) 
library(ggplot2) 
library(data.table) 
library(reshape2)  

# Using the code from the previous section 
# This computes the mean arrival and departure delays by carrier. 
DT <- as.data.table(flights) 
mean2 = DT[, list(mean_departure_delay = mean(dep_delay, na.rm = TRUE), 
   mean_arrival_delay = mean(arr_delay, na.rm = TRUE)), 
   by = carrier]  

# In order to plot data in R usign ggplot, it is normally needed to reshape the data 
# We want to have the data in long format for plotting with ggplot 
dt = melt(mean2, id.vars = ’carrier’)  

# Take a look at the first rows 
print(head(dt))  

# Take a look at the help for ?geom_point and geom_line to find similar examples 
# Here we take the carrier code as the x axis 
# the value from the dt data.table goes in the y axis 

# The variable column represents the color 
p = ggplot(dt, aes(x = carrier, y = value, color = variable, group = variable)) +
   geom_point() + # Plots points 
   geom_line() + # Plots lines 
   theme_bw() + # Uses a white background 
   labs(list(title = 'Mean arrival and departure delay by carrier', 
      x = 'Carrier', y = 'Mean delay')) 
print(p)  

# Save the plot to disk 
ggsave('mean_delay_by_carrier.png', p,  
   width = 10.4, height = 5.07)

Il codice dovrebbe produrre un'immagine come la seguente: