【问题标题】:Accuracy value of 0 even after testing several loss functions即使在测试了几个损失函数后,准确度值为 0
【发布时间】:2020-07-16 11:11:40
【问题描述】:

我想预测价格:

X=dataset.iloc[:,1:12]

Y=dataset.iloc[:,0:1]
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3)


//this is my neural network
model=Sequential([
    Dense(32,activation='relu',input_shape=(10,)),
    Dense(32,activation='relu'),
    Dense(1,activation='sigmoid'),
])

model.compile(loss='binary_crossentropy',
             optimizer='sgd',
             metrics=['accuracy'])

hist = model.fit(X_train, Y_train,
          batch_size=20, epochs=100,
              validation_data=(X_test, Y_test))

我的准确度为 0。
帮我解决这个问题。
我也改变了我的损失函数,但准确度没有增加。

【问题讨论】:

标签: python tensorflow keras keras-layer


【解决方案1】:

正如 cmets 所说,这是一个回归问题,准确度不是一个好的衡量标准。 问题在于层激活和损失函数。根据您的问题,您应该使用图像中的一种组合

【讨论】:

    猜你喜欢
    • 2020-08-19
    • 1970-01-01
    • 2017-12-17
    • 1970-01-01
    • 2021-04-23
    • 2018-09-06
    • 2020-11-08
    • 1970-01-01
    • 2020-07-02
    相关资源
    最近更新 更多