企业员工绩效管理系统
1. 场景
在这个场景中,我们需要设计一个算法来评估企业员工的绩效。我们将通过各种绩效指标为员工分配分数,然后根据总分对员工进行评级。
2. 业务说明
绩效指标如下:
- 任务完成情况(百分比)
- 团队协作能力(1-10分)
- 创新能力(1-10分)
- 与客户沟通能力(1-10分)
现在,我们需要设计一个算法,将这些指标组合成一个综合得分,然后对员工进行评级。评级标准如下:
- A级:综合得分 >= 90
- B级:综合得分 >= 80
- C级:综合得分 >= 70
- D级:综合得分 < 70
3. 代码落地
3.1 python语言实现
def calculate_performance_score(task_completion, teamwork, innovation, communication):
total_score = (task_completion * 0.4) + (teamwork * 0.2) + (innovation * 0.2) + (communication * 0.2)
return total_score
def assign_performance_grade(score):
if score >= 90:
return 'A'
elif score >= 80:
return 'B'
elif score >= 70:
return 'C'
else:
return 'D'
# 示例数据
employees = [
{
'name': 'Alice', 'task_completion': 95, 'teamwork': 8, 'innovation': 7, 'communication': 9},
{
'name': 'Bob', 'task_completion': 85, 'teamwork': 7