-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.py
More file actions
84 lines (59 loc) · 1.93 KB
/
Copy path4.py
File metadata and controls
84 lines (59 loc) · 1.93 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- coding: utf-8 -*-
"""JOB-25 career_recommendation.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1kYu9jWQSTeXu31D_JHI37iWrbnDNfuCr
**CAREER RECOMMENDATION**
**The Objective is **
Load and Prepare data
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
import pandas as pd
df = pd.read_excel("New jobready_career_skill_dataset_1000_rows_v2.xlsx")
# Remove duplicates
df = df.drop_duplicates()
df
career_skills = df.groupby('Career').apply(
lambda x: list(zip(
x['Skill/Sub-skill'],
x['Weight'],
x['Threshold (0-100)'],
x['Level Required']
))
).to_dict()
user_profile = {
"skills": ["Python", "SQL", "Machine Learning", "Data Analysis"],
"level": "Intermediate"
}
def match_career(user_profile, career_skills):
scores = {}
user_skills = set(user_profile["skills"])
user_level = user_profile["level"]
level_map = {
"Beginner": 1,
"Intermediate": 2,
"Advanced": 3
}
for career, skills in career_skills.items():
score = 0
for skill, weight, threshold, level in skills:
# Skill match
if skill in user_skills:
score += weight * 100 # boost score
# Level match
if level_map[user_level] >= level_map[level]:
score += 5
# Threshold influence
score += (threshold / 100)
scores[career] = score
return sorted(scores.items(), key=lambda x: x[1], reverse=True)
recommendations = match_career(user_profile, career_skills)
for career, score in recommendations:
print(career, score)