Code Monkey home page Code Monkey logo

Comments (1)

NGYB avatar NGYB commented on July 23, 2024

Hi @viper7882,

Thanks for your comments. They are very encouraging and I am happy that you found the projects fun.

I read through your comments carefully, I believe you are talking about this section of the code in the Final model section:

rmse, mape, est = train_pred_eval_model(X_train_cv_scaled, y_train_cv_scaled, X_sample_scaled, y_sample, test['adj_close_mean'], test['adj_close_std'], seed=model_seed, n_estimators=n_estimators_opt, max_depth=max_depth_opt, learning_rate=learning_rate_opt, min_child_weight=min_child_weight_opt, subsample=subsample_opt, colsample_bytree=colsample_bytree_opt, colsample_bylevel=colsample_bylevel_opt, gamma=gamma_opt)

And you said I should replace X_sample_scaled with X_cv_scaled. I don't agree with you this should be the case.

Firstly, please note that the model is intended to predict the value for day t (note we are doing a one-day prediction and not multiple days prediction), based on values from days t-1, t-2, ... and so on. These features of lags t-1, t-2, ... are contained in the X_sample_scaled(= test_scaled[features]). So we are passing the right stuff in.

If you pass in X_cv_scaled, then you are doing model.predict(X_cv_scaled) and obtaining the predictions for X_cv_scaled. But we are not interested in predictions for X_cv_scaled at the 'Final model' section, because we want predictions for X_sample_scaled instead.

Let me know if the above is clear, thanks. Again, thanks for sharing the issue with me.

from stocks.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.