-1

I want to predict price of:

Screen shot

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))

I am having accuracy of 0.
help me to solve this.
I also changed my loss functions but the accuracy is not increasing.

swiss_knight
  • 5,787
  • 8
  • 50
  • 92
Abubakar
  • 43
  • 5
  • 1
    Price is continuous, it makes no sense to compute accuracy on continuous variables. – Dr. Snoopy Apr 04 '20 at 09:36
  • 1
    Its regression problem, you should probably use MSE/RMSE – David Apr 04 '20 at 09:38
  • Welcome to StackOverflow! I see you're a new contributor, so I advise you to check out [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [How to create a minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Brian61354270 Apr 04 '20 at 17:41

1 Answers1

1

As the comments say, this is a regression problem and accuracy is not a good measure. The problem is the layer activation and the loss function. Depending on your problem you should use one of the combinations in the imageenter image description here

Igna
  • 1,078
  • 8
  • 18