Machine learning 为什么我的;val_准确度";从高价值开始?

Machine learning 为什么我的;val_准确度";从高价值开始?,machine-learning,deep-learning,neural-network,prediction,confusion-matrix,Machine Learning,Deep Learning,Neural Network,Prediction,Confusion Matrix,我正在使用威斯康星州的乳腺癌数据,并与ANN一起在keras图书馆进行研究 我在下面添加了代码和一部分数据,我希望它可读性和可理解性 数据集中的一行:1000025,5,1,1,1,2,1,3,1,1,2 预测结果: 测试损失:0.05948319600096771-测试精度:0.9809523820877075 以下是导入库后代码的主要部分: 以及图形和混淆矩阵图: 没有看到您的代码和数据,没有人能告诉您为什么会看到这样的准确性。请包括。谢谢。非常感谢您的回复,先生。我试着尽我所能地添加所

我正在使用威斯康星州的乳腺癌数据,并与ANN一起在keras图书馆进行研究

我在下面添加了代码和一部分数据,我希望它可读性和可理解性

数据集中的一行:
1000025,5,1,1,1,2,1,3,1,1,2

预测结果:

测试损失:0.05948319600096771-测试精度:0.9809523820877075

以下是导入库后代码的主要部分:

以及图形和混淆矩阵图:


没有看到您的代码和数据,没有人能告诉您为什么会看到这样的准确性。请包括。谢谢。非常感谢您的回复,先生。我试着尽我所能地添加所有内容。
data = pd.read_csv('breast-cancer-wisconsin.data')
data_new = data.drop(['1000025'],axis=1)

X = data_new.iloc[:,0:8].values
Y = data_new.iloc[:,9].values

labelencoder_= LabelEncoder()
Y = labelencoder_.fit_transform(Y)

X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.15, random_state = 0)

#Feature Scaling
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test)

classifier = Sequential()
classifier.add(Dense(8, input_dim=8))
classifier.add(Activation("relu"))
classifier.add(Dropout(0.1))
classifier.add(Dense(32))
classifier.add(Activation("relu"))
classifier.add(Dropout(0.1))
classifier.add(Dense(16))
classifier.add(Activation("relu"))
classifier.add(Dropout(0.1))
classifier.add(Dense(1))
classifier.add(Activation("sigmoid"))

classifier.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])

history = classifier.fit(X_train, y_train, epochs=100, batch_size=10, validation_split=0.11)

test_loss, test_acc = classifier.evaluate(X_test, y_test)

print('\nTest Loss:', test_loss)
print('Test Accuracy:', test_acc)

y_pred = classifier.predict(X_test)
#LOSS---
training_loss = history.history['loss']
test_loss = history.history['val_loss']

epoch_count = range(1, len(training_loss) + 1)

plt.plot(epoch_count, training_loss, 'r-')
plt.plot(epoch_count, test_loss, 'b-')
plt.legend(['Training Loss', 'Test Loss'])
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.show()


#ACCURACY---
training_acc = history.history['accuracy']
test_acc = history.history['val_accuracy']

epoch_count2 = range(1, len(training_acc) + 1)

plt.plot(epoch_count2, training_acc, 'r-')
plt.plot(epoch_count2, test_acc, 'b-')
plt.legend(['Training Accuracy','Test Accuracy'])
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.show()


ConfMatrix = confusion_matrix(y_test,pred)
ax = sns.heatmap(ConfMatrix, annot=True, cmap="gray", fmt="d", xticklabels = ['Benign', 'Malignant'], yticklabels = ['Benign', 'Malignant'])
bottom, top = ax.get_ylim()
ax.set_ylim(bottom + 0.5, top - 0.5)
plt.ylabel('True')
plt.xlabel('Prediction')
plt.title("Confusion Matrix");
plt.figure(figsize=(7,17))