探索紙鈔資料
你將使用 Banknote Authentication 資料集,在 Keras 中練習建立分類模型。
你的目標是區分真鈔與假鈔。為了達成這個目的,資料集中提供了 4 個特徵:variance、skewness、kurtosis 和 entropy。這些特徵是對紙鈔影像進行數學運算後得到的。標籤位於資料框架的 class 欄位中。
一個名為 banknotes 的 pandas DataFrame 已可使用,來做些資料探索吧!
本練習屬於課程
Keras 深度學習入門
練習說明
- 匯入
seaborn並命名為sns。 - 對
banknotes使用seaborn的pairplot(),並將hue設為包含標籤之欄位的名稱。 - 產生紙鈔驗證資料的描述統計。
- 使用
.value_counts()統計每個標籤的觀測筆數。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Import seaborn
import ____ as ____
# Use pairplot and set the hue to be our class column
sns.____(____, hue=____)
# Show the plot
plt.show()
# Describe the data
print('Dataset stats: \n', banknotes.____)
# Count the number of observations per class
print('Observations per class: \n', banknotes[____].____)