I am new to machine learning . I am trying to predict two numerical columns from a data set. The columns that i have to predict are Amount and number of days . Amount, number of days are features and all other columns are labels.

ID  Category    Company Amount  No_of_days
x1  c1             A    338.07   5
x2  c2             B    46.21    35
x4  c1             C    1480     35
x1  c3             C    2018     48
x2  others         A    4344    -10

I have tried fitting the data set with neural network from keras Pre processing steps I have done are one hot encoding and min max scalar.

I have tried adding more layers,more neurons,changing number of epochs,and activation layer to sigmoid and leaky relu.

Code:


model = Sequential()

# The Input Layer :
model.add(Dense(64, kernel_initializer='normal',input_dim = X_train.shape[1], activation='relu'))

# The Hidden Layers :
model.add(Dense(256, kernel_initializer='normal',activation='relu'))
model.add(Dense(256, kernel_initializer='normal',activation='relu'))
model.add(Dense(256, kernel_initializer='normal',activation='relu'))
model.add(Dense(64, kernel_initializer='normal',activation='relu'))

# The Output Layer :
model.add(Dense(2, kernel_initializer='normal',activation='linear'))

# Compile the network :
model.compile(loss='mean_absolute_error', optimizer='adam', metrics=['mean_absolute_error'])

checkpoint_name = 'Weights-{epoch:03d}--{val_loss:.5f}.hdf5' 
checkpoint = ModelCheckpoint(checkpoint_name, monitor='val_loss', verbose = 1, save_best_only = True, mode ='auto')
callbacks_list = [checkpoint]

model.fit(X_train, y_train, epochs=50, batch_size=32,validation_split = 0.2, callbacks=callbacks_list)

The Predicted two columns are no way match with actual test columns and RMSE Score that am getting is 40860.So i don't know how to move forward to get more accurate prediction.Kindly help me where i am going wrong? where i have to make the changes to predict multiple columns?

Related posts

Recent Viewed