sns.barplot的y軸問題?
2019/09/19 上午 08:25
機器學習共學討論版
Ma Chao Ting
觀看數:82
回答數:1
收藏數:0
ml100-3
ml100-3-d16
在D16中
plt.figure(figsize = (8, 8))
# 以年齡區間為 x, target 為 y 繪製 barplot
"""
Your Code Here
"""
px = age_data['YEARS_BINNED']
py = age_data['TARGET']
sns.barplot(px, py)
# Plot labeling
plt.xticks(rotation = 75); plt.xlabel('Age Group (years)'); plt.ylabel('Failure to Repay (%)')
plt.title('Failure to Repay by Age Group');
想要問的是我的y軸為何會變0.xx的數字,我並沒有對她做任何處理
用values_count()也只有0跟1
想請教為什麼會變這樣?
回答列表
-
2019/09/19 上午 10:26張維元 (WeiYuan)贊同數:1不贊同數:0留言數:0
嗨,barplot 中有一個參數 estimator 會同一組的資料怎麼組合,預設會用平均數。改成其他的會像這樣: