Correlation

Analyzing IoT Data in Python

Matthias Voppichler

IT Developer

df.corr()

print(data.corr())
             temperature  humidity  sunshine  light_veh  heavy_veh
temperature     1.000000 -0.734430  0.611041   0.401997   0.408936
humidity       -0.734430  1.000000 -0.637761  -0.313952  -0.318198
sunshine        0.611041 -0.637761  1.000000   0.408854   0.409363
light_veh       0.401997 -0.313952  0.408854   1.000000   0.998473
heavy_veh       0.408936 -0.318198  0.409363   0.998473   1.000000
Analyzing IoT Data in Python

heatmap

sns.heatmap(data.corr(), annot=True)

Heatmap of data correlation

Analyzing IoT Data in Python

heatmap

sns.heatmap(data.corr(), annot=True)

Heatmap of data correlation - with highlight to high negative correlation (temperature / humidity)

Analyzing IoT Data in Python

heatmap

sns.heatmap(data.corr(), annot=True)

Heatmap of data correlation - with highlight on positive correlation (sunshine / temperature)

Analyzing IoT Data in Python

heatmap

sns.heatmap(data.corr(), annot=True)

Heatmap of data correlation - highlight on very high positive correlation (light/heavy vehicle)

Analyzing IoT Data in Python

Pairplot

sns.pairplot(data)

Pairplot of 4 columns

Analyzing IoT Data in Python

Summary

  • heatmap
    • Negative correlation
    • Positive correlation
    • Correlation close to 1
Analyzing IoT Data in Python

Let's practice!

Analyzing IoT Data in Python

Preparing Video For Download...