Data Science Asked on October 15, 2020
I implemented a Keras model for my all-integer dataset with values greater than or equal to 0. The train data has dimensions of (393, 108)
and prediction data has (1821, 108)
. Code is as follows.
import keras
from keras.models import Sequential
from keras.layers import Dense
X = data.iloc[:, :-1]
y = data.iloc[:, -1]
model = Sequential()
model.add(Dense(X.shape[1]-1, input_dim=X.shape[1], activation='tanh'))
for i in range(X.shape[1] - 2, 2, -100):
model.add(Dense(i, activation='tanh'))
model.add(Dense(1, activation='tanh'))
opt = keras.optimizers.Adam(learning_rate=100)
model.compile(loss='categorical_crossentropy', optimizer=opt)
model.fit(X, y)
model.predict(X0)
I am getting all nan
values as results.
array([[nan],
[nan],
[nan],
...,
[nan],
[nan],
[nan]], dtype=float32)
Other suggested changes -
Correct answer by 10xAI on October 15, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP