-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpercentile_calculator.py
More file actions
56 lines (46 loc) · 2.51 KB
/
Copy pathpercentile_calculator.py
File metadata and controls
56 lines (46 loc) · 2.51 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
51
52
53
54
55
56
from docx import Document
# Load the newly provided resume
new_resume_path = "/mnt/data/Vinicio Solutions Architect Resume CV.docx"
# Reuse previous assumed percentiles for competitors
competitor_percentiles = [55, 60, 70, 75] # Candidate 1 to 4
your_percentile = 90 # Assumed for the updated resume
worst_case_percentile = 50
best_case_percentile = 95
# Recalculate scores and statistics for the new dataset
new_extended_percentiles = competitor_percentiles + [your_percentile, worst_case_percentile, best_case_percentile]
new_extended_candidates = ["Candidate 1", "Candidate 2", "Candidate 3", "Candidate 4", "Your Resume", "Worst Case", "Best Case"]
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