Professional Documents
Culture Documents
PhamVanTrung KTGK
PhamVanTrung KTGK
import numpy as np
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
# d. Giá trị lớn nhất, bé nhất, và trung bình của các cột thuộc
tính có giá trị số thực
numerical_summary = df[continuous_columns].describe().loc[['min',
'max', 'mean']]
print("\nGiá trị lớn nhất, bé nhất, và trung bình của các cột thuộc
tính có giá trị sốthực:\n", numerical_summary)
# Vẽ biểu đồ
plt.figure(figsize=(8, 6))
unique_labels = df_pca['quality'].unique()
colors = plt.cm.rainbow(np.linspace(0, 1, len(unique_labels)))
1 13.89
2 13.53
3 13.21
4 13.27
----------------------------------------------------------------------
-----
AttributeError Traceback (most recent call
last)
<ipython-input-3-dcfac36c400a> in <cell line: 12>()
10
11 # Hiển thị 5 dòng đầu tiên đểkiể m tra
---> 12 print("Dữ liệu mẫ u:\n", df.head())
13
14 # Chọn các cột thuộc tính là giá trị liên tục