Professional Documents
Culture Documents
Regression Revenue
Regression Revenue
data = pd.read_csv('Revenue_Regression.csv')
print(data.head())
import seaborn as sns
from scipy.stats import pearsonr
sns.pairplot(data, x_vars=['all_activity_dur', 'reached_call_outbound',
'answered_inbound_call'], y_vars=['Revenue'])
plt.show()
corr1, _ = pearsonr(data['Revenue'], data['all_activity_dur'])
corr2, _ = pearsonr(data['Revenue'], data['reached_call_outbound'])
corr3, _ = pearsonr(data['Revenue'], data['answered_inbound_call'])
print(f"Correlation between Revenue and all_activity_dur: {corr1:.2f}")
print(f"Correlation between Revenue and reached_call_outbound: {corr2:.2f}")
print(f"Correlation between Revenue and answered_inbound_call: {corr3:.2f}")
import statsmodels.api as sm