Data for last day in data frame

Course Name: Neural Networks in Trading, Section No: 1, Unit No: 18, Unit type: Quiz



Going through the python code given in course for MLP Classifier. The code always removes the data for last day since we dont have future returns available for last day (formula is close.shift (-1). This row is removed when we dropna()



How do we tackle this practically ? It essentially means that we dont have the predicted return data avaible up until next day (which is anyways stale and doesnt make sense)



Is there a way we can tweak python code to address this ?

Hi Ankit,



The shift(-1) is done for training and testing the model. For deployment, you need to use the trained model with the new input data (appropriately transformed as the X input) and then use the model.predict method to obtain the prediction. 



Hope this helps!

Thanks.