Menu

Correlation Analysis (Numerical Features)

Correlation Analysis (Numerical Features)

Although most of our data is textual, we have created one numerical feature: the review length. We can examine whether there is any relationship between review length and the review label.

Code

correlation = df[['review_length', 'label']].corr()
correlation

Heatmap Visualization

plt.figure(figsize=(5,4))
sns.heatmap(
correlation,
annot=True,
cmap='Blues'
)
plt.title("Correlation Heatmap")
plt.show()

Explanation

The heatmap shows the correlation between numerical features.

A value close to 1 indicates a strong positive relationship, while a value close to 0 indicates little or no relationship.

Since this project mainly uses textual features, the correlation values may not be very strong.