Menu

Fake vs Genuine Review Distribution

Fake vs Genuine Review Distribution

Instead of analyzing all reviews together, it is useful to separate fake and genuine reviews to observe their distribution individually.

Code

fake_reviews = df[df['label'] == 1]
genuine_reviews = df[df['label'] == 0]
print("Fake Reviews:", len(fake_reviews))
print("Genuine Reviews:", len(genuine_reviews))

Plot the Distribution

plt.figure(figsize=(6,6))
plt.pie(
df['label'].value_counts(),
labels=['Genuine', 'Fake'],
autopct='%1.1f%%',
startangle=90
)
plt.title("Percentage of Fake and Genuine Reviews")
plt.show()

Explanation

The pie chart shows the proportion of fake and genuine reviews in the dataset.

If both classes occupy similar portions of the chart, the dataset is well-balanced.