1
$\begingroup$

I am working on shipment days delivery problem , where i want to predict shipment days (continuous variable target)

I have tries both Neural Network and Random Forest regressors ,i got very low error rate if i consider MAE or MSE but if i compare actual ship days and predicted ship days i get lot of differences in most of the values. What i am trying to do is that (actual ship days - predicted ship days) should have 5 days as difference in most of the records , but i am getting huge differences in most of the samples

  1. training samples : 1.1 million records
  2. test samples : 0.9 million records

algo1 : random forest regressor (with default parameters)

algo2 : neural network

loss: 46.2513 - mae: 5.2729 - val_loss: 46.5231 - val_mae: 5.2836

my code:

network = models.Sequential()
network.add(layers.Dense(128, activation='relu', input_shape=(23,)))
network.add(layers.Dropout(0.5))
network.add(layers.Dense(64, activation='relu'))
network.add(layers.Dropout(0.5))
network.add(layers.Dense(1,activation='linear'))

network.compile(loss='mean_squared_error', optimizer='adam', metrics=['mae'])

history = network.fit(X_train_scaled, train_ship_days,
                    validation_data=(X_test_scaled, test_ship_days),
                    epochs=50,
                    batch_size=128)

final goal : actual ship days and predict_ship_Days should have minimum difference for at least 80 % of records

suggest me some algorithm or techniques which i can implement

$\endgroup$
1
$\begingroup$

Why are you limiting yourself to only 2 models? There are a plethora of different algorithms, both in ML and DL. Try them and see which gives the desired results.

Also I noticed you haven't done any preprocessing in your model. Might be that for length purpose, you only showed the relevant part of the code. If that is so, then it's alright but if it's not, then you should probably preprocess your data. For Neural Nets, scaling is a very important step.

Also you can try hyperparameter tuning of your models to improve your results.

As for different algorithms you can try, here is a link of different types of classification and regression algorithms along with different types of neural nets.

Another link which shows how to select which type of algorithm one should choose based on the data one has.

$\endgroup$
2
  • $\begingroup$ yes preprocessing part is not shown here ,also scaling is done with StandardScaling currently doing parameter tuning , but if you can suggest some more algorithm which can give me exact predictions then it will be helpful $\endgroup$ Dec 4 '21 at 18:03
  • $\begingroup$ I've updated my answer $\endgroup$
    – spectre
    Dec 5 '21 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.