<aside> 📌 Task : 데이터 분석을 바탕으로 시각화 시키기

</aside>

❤구독 플랜별 이탈 시점에서 유의미한 차이를 보일 것이다.❤

→ 구독 플랜이 유료인 유저가 더 적게 이탈할것이다.

<aside> 📌 실행 및 진행 사항 정리

</aside>

<aside> 📌 결과

</aside>

구독 플랜 별 평균 이탈시점, 이탈률, 마지막 접속 시간

수정 후

  1. 비율 기준
# 1. 평균 이탈 위치
exit_mean = final_merge.groupby('subscription_plan')['exit_position_numeric'].mean()

# 2. 이탈률 계산
dropout_rate = final_merge.groupby('subscription_plan')['이탈여부확인'].apply(
    lambda x: (x == '이탈').mean())

# 3. 활동 시간대(work_last_access_time) 분포 (비율)
work_time_dist = final_merge.groupby(['subscription_plan', 'work_last_access_time']).size().unstack(fill_value=0)
work_time_dist = work_time_dist.div(work_time_dist.sum(axis=1), axis=0)  # 비율로 정규화

# 4. 이탈 사유(category) 분포 (비율)
dropout_cat_dist = final_merge.groupby(['subscription_plan', 'dropout_reason_category']).size().unstack(fill_value=0)
dropout_cat_dist = dropout_cat_dist.div(dropout_cat_dist.sum(axis=1), axis=0)  # 비율로 정규화

# 5. 하나로 합치기
summary_df = pd.DataFrame({
    '평균 이탈 위치': exit_mean,
    '이탈률': dropout_rate
})

# 6. 활동 시간대와 이탈 사유 비율 통합
summary_df = summary_df.join(work_time_dist, how='left')
summary_df = summary_df.join(dropout_cat_dist, how='left')

# 보기 좋게 정렬
summary_df.reset_index(inplace=True)

image.png

  1. 개수 기준
# 1. 평균 이탈 위치
exit_mean = final_merge.groupby('subscription_plan')['exit_position_numeric'].mean()

# 2. 이탈률 계산 (요청한 방식 그대로)
dropout_rate = final_merge.groupby('subscription_plan')['이탈여부확인'].apply(
    lambda x: (x == '이탈').mean()
)

# 3. 활동 시간대(work_last_access_time)별 count
work_time_count = final_merge.groupby(['subscription_plan', 'work_last_access_time']).size().unstack(fill_value=0)

# 4. 이탈 사유(category)별 count
dropout_cat_count = final_merge.groupby(['subscription_plan', 'dropout_reason_category']).size().unstack(fill_value=0)

# 5. 하나로 합치기
summary_df = pd.DataFrame({
    '평균 이탈 위치': exit_mean,
    '이탈률': dropout_rate
})

summary_df = summary_df.join(work_time_count, how='left')
summary_df = summary_df.join(dropout_cat_count, how='left')
summary_df.reset_index(inplace=True)

# 결과 보기
summary_df

image.png

⭐여기서 도출할 수 있는 결론

팀원들 피드백 : 결론은 다 합쳐서 정하는게 좋을것같다고 생각!