-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoisson_xlsx_analytics.py
More file actions
50 lines (42 loc) · 2.12 KB
/
Copy pathpoisson_xlsx_analytics.py
File metadata and controls
50 lines (42 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Redefine necessary imports for numerical and visualization tasks
import pandas as pd
import numpy as np
from scipy.stats import poisson, norm, zscore
import matplotlib.pyplot as plt
from docx import Document
# Recalculate scores and statistics for the new dataset
new_extended_scores = [percentile_to_score(p) for p in new_extended_percentiles]
new_mean_score = np.mean(new_extended_scores)
new_std_dev = np.std(new_extended_scores)
new_extended_z_scores = [(score - new_mean_score) / new_std_dev for score in new_extended_scores]
# Create a new DataFrame for the updated data
new_extended_data = pd.DataFrame({
"Candidate": new_extended_candidates,
"Percentile": new_extended_percentiles,
"Score": new_extended_scores,
"Z-Score": new_extended_z_scores
})
# Save the updated data to an Excel file
new_extended_excel_path = "/mnt/data/New_Extended_Resume_Score_Comparison.xlsx"
new_extended_data.to_excel(new_extended_excel_path, index=False)
# Generate updated visualizations
fig, axs = plt.subplots(2, 1, figsize=(12, 10), sharex=True)
# Bar chart for scores and percentiles
axs[0].bar(new_extended_data["Candidate"], new_extended_data["Score"], alpha=0.7, label="Scores")
axs[0].plot(new_extended_data["Candidate"], new_extended_data["Percentile"], marker="o", color="orange", label="Percentile Trend")
axs[0].axhline(new_mean_score, color="red", linestyle="--", label="Mean Score")
axs[0].set_title("Updated Resume Match Scores and Percentiles")
axs[0].set_ylabel("Scores / Percentiles")
axs[0].legend()
axs[0].grid(axis="y", linestyle="--", alpha=0.7)
# Line chart for Z-scores
axs[1].plot(new_extended_data["Candidate"], new_extended_data["Z-Score"], marker="o", label="Z-Score", color="green")
axs[1].axhline(0, color="red", linestyle="--", label="Mean Z-Score")
axs[1].set_title("Updated Z-Score Analysis")
axs[1].set_ylabel("Z-Score")
axs[1].legend()
axs[1].grid(axis="y", linestyle="--", alpha=0.7)
plt.tight_layout()
new_chart_combo_path = "/mnt/data/Updated_Complex_Resume_Score_Comparison_Charts.png"
plt.savefig(new_chart_combo_path)
new_extended_excel_path, new_chart_combo_path