我有一个总共 8000 个声音样本的数据集。这些是我的多层神经网络二元分类器的结果:
Precision: [0.95 0.96]
Recall: [0.96 0.95]
F-Score: [0.95 0.95]
S: [1217. 1254.]
Accuracy training 1.0
Accuracy Test 0.95
我对测试的准确性、精度和召回率感到满意。但是 1.0 的准确度让我感到困扰,因为它对训练集的过度拟合。即使测试集的准确性令人满意,这是一件坏事吗?
下面我从磁盘加载汽车声音特征(1)和其他类型的声音特征(0)并分配标签。我仔细检查了,在处理和提取音频特征时,我没有添加标签作为特征。集合被削减为每个等于 4100 个样本
car_features =np.load('car_features_final.npy')
car_labels =np.ones(len(car_features),dtype=int)
shuffle(car_features, random_state=12)
other_features = np.load('other_features.npy')
other_features=list(islice(shuffle(other_features, random_state=12),4100))
other_labels = np.zeros(len(other_features),dtype=int)
shuffle(other_features, random_state=12)
all_features = np.append(car_features, other_features, axis=0)
all_labels = np.append(car_labels,other_labels, axis=0)
X_train, X_test, y_train, y_test = train_test_split(all_features, all_labels, test_size=0.30, random_state=42)
clf = MLPClassifier(activation='relu', solver='adam', alpha= 0.1, hidden_layer_sizes=(300, 300, 300, 100), random_state=1, max_iter=500)
clf.fit(X_train, y_train)
y_predicted_test = clf.predict(X_test)
y_predicted_train = clf.predict(X_train)
p,r,f,s = precision_recall_fscore_support(y_test, y_predicted_test)