如何获得keras模型的准确性,F1,准确性和召回率?
我想为我的二进制KerasClassifier模型计算精度,召回率和F1分数,但找不到任何解决方案。 这是我的实际代码: # Split dataset in train and test data X_train, X_test, Y_train, Y_test = train_test_split(normalized_X, Y, test_size=0.3, random_state=seed) # Build the model model = Sequential() model.add(Dense(23, input_dim=45, kernel_initializer='normal', activation='relu')) model.add(Dense(1, kernel_initializer='normal', activation='sigmoid')) # Compile model model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) tensorboard = TensorBoard(log_dir="logs/{}".format(time.time())) time_callback = TimeHistory() # Fit the model history …