generated from LufsX/Experiment-kNN
This commit is contained in:
+1
-3
@@ -65,9 +65,7 @@ def load_dataset(directory):
|
||||
|
||||
inv_cov_matrix = np.linalg.inv(cov_matrix_regularized)
|
||||
# 计算均值向量和协方差矩阵
|
||||
mean_vector = np.mean(features, axis=0)
|
||||
cov_matrix = np.cov(features, rowvar=False)
|
||||
inv_cov_matrix = np.linalg.inv(cov_matrix) # 计算协方差矩阵的逆
|
||||
|
||||
|
||||
return features, labels, mean_vector, inv_cov_matrix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user