0

Result image

I have generated a bar graph in this way using the code

import numpy as np
import smote_variants as sv
import matplotlib.pyplot as plt
import pandas as pd
LABELS=["Classes not changed","Classes changed"]
data=pd.read_csv("C:\\Users\\HP\\OneDrive\\Documents\\Dissertation\\My dataset\\JSettlers\\CSV files for WEKA (JSettlers)\JSettlers 1.1.18 metrics (change prone).csv")
columns=data.columns.tolist()
columns=[c for c in columns if c not in ["CLASS NAME","Change Prone"]]
target="Change Prone"
X=data[columns]
Y=data[target]
count_classes=pd.value_counts(data['Change Prone'],sort=True)
count_classes.plot(kind='bar',rot=0)
plt.title('JSettlers 1.1.18 before imbalanced learning')
plt.xticks(range(2),LABELS)
plt.xlabel('Change Prone')
plt.ylabel('Frequency')

Above each bar, I want the value of that bar to be calculated and be displayed above that bar. How do I do that?

0 Answers0