How to predict Stock Prices with Python using Facebook's prediction tool fbprophet

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024

ความคิดเห็น • 63

  • @hijamgyaneswarsingh879
    @hijamgyaneswarsingh879 2 ปีที่แล้ว +2

    Thank you for this video and it really helped me to understand the concept of facebook prophet. Sir, I'm facing some issues even after installation in different environment python version 3.8 but it failed to import in jupyter notebook. No module found Prophet

  • @sanjaydhande6573
    @sanjaydhande6573 2 ปีที่แล้ว +1

    Thanks for such nice video series. The series is very helpful, to the point. Great explanation with good examples. Thanks again!

    • @Algovibes
      @Algovibes  2 ปีที่แล้ว

      Thanks for your feedback. Pretty old video tho :D

  • @saumyadeepsur2314
    @saumyadeepsur2314 2 ปีที่แล้ว +1

    Thanks a lot for this. It was quite helpful. Just a small question though- How to put legends in the final Forecast graph?

    • @Algovibes
      @Algovibes  2 ปีที่แล้ว

      Thanks mate. Should work just as you would do it with a standard plot in Matplotlib.

  • @Британскиеучёные-ч6х
    @Британскиеучёные-ч6х 3 ปีที่แล้ว +1

    great video! Thank you very much! Listen, I don't understand English, can you answer one question? Why are the GOOG shares on the chart so different from your model? I mean, why doesn't your model take into account the data we know? Why are the black dots and the blue line diverging?

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +2

      Privet and thank you very much for your comment :-)
      The black dots are the real datapoints, while the blue line is the prediction.
      Check this out for more information:
      facebook.github.io/prophet/docs/quick_start.html
      Best regards

  • @xwclsg
    @xwclsg 3 ปีที่แล้ว +1

    Thanks for this great video. I was wondering whether we could get the predicted distribution by using Prophet. More specifically, can we get the predicted conditional quantiles of the predictand? Many thanks in advance.

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว

      Thanks a lot for your kind comment :-) From what I know is that when instantiating (The part where I set model = Prophet()) you can define an uncertainty interval (which is 0.8 by default) by taking the interval.width argument.
      Does this answer your question or am I getting you wrong?
      Best regards

    • @xwclsg
      @xwclsg 3 ปีที่แล้ว +1

      @@Algovibes Thanks for the quick reply. Yes, I can see from the figure that we can obtain a condifence interval. But instead of the predictive interval, can we also obtain the probabilistic forecasts through a set of preset quantiles? I am sorry if my question is a bit off topic here, I am currently working on some quantile regression NNs so I am more interested in getting conditional quantiles to depict the complete picture of predicted distributions related to the predictand. Thx again.

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว

      @@xwclsg I was interested in that as well so I did a bit of research: github.com/facebook/prophet/issues/1392
      Check out this link. It is not exactly what you are looking for but maybe an idea.
      BTW I would be very interested in your project! If you want you can reach out to me. I will put in a contact link in my about me page soon.

    • @xwclsg
      @xwclsg 3 ปีที่แล้ว +1

      @@Algovibes Thanks again for your reply. I just checked the link you attached and it was really helpful, it seems that we could get a set of quantiles of interest based on the sampling of regressors in this case. But it would be great if we could do it nonparametrically instead of relying on some distributional assumptions of regressors. I will definitely reach out to u mate, thx again.

  • @modchat4510
    @modchat4510 4 ปีที่แล้ว +1

    Thank you for making me rich :-). Very good explanation good job! Schöne Grüße aus Hamburg

    • @Algovibes
      @Algovibes  4 ปีที่แล้ว

      Hey mod chat,
      Thank you for your kind feedback.
      There will be even better ones on this channel, stay tuned :-)

  • @shahedahmed7579
    @shahedahmed7579 2 ปีที่แล้ว +1

    Thank you so much man!!! btw How do I calculate RMSE here?

    • @Algovibes
      @Algovibes  2 ปีที่แล้ว

      Welcome :-)
      It's been quite a long time since I used fbprophet. As far as I remember you have a yhat column and a true y column so you could to the calculation using sklearn or manual calculation.
      More background here - anyhow I was using MSE here but the logic is the same:
      th-cam.com/video/B6O-mirYfWw/w-d-xo.html

  • @vijaysinghrajput8526
    @vijaysinghrajput8526 4 ปีที่แล้ว

    Excellent work!!

    • @Algovibes
      @Algovibes  4 ปีที่แล้ว +1

      Hi vijay rajput,
      thank you so much for your feedback :-)

  • @Think-t5n
    @Think-t5n 4 ปีที่แล้ว +1

    Why does "exception model has not been fit" appear when running "future=model.make_future_dataframe(periods=365)”?How can I solve it?

    • @Algovibes
      @Algovibes  4 ปีที่แล้ว

      Hi :)
      Did you fit the model before calling the make_future_dataframe function ?
      syntax:
      model.fit(df)
      Hope this resolves your issue. In case it doesn't please let me know!

  • @elu1
    @elu1 ปีที่แล้ว +1

    installation changed: conda install -c conda-forge prophet

    • @zhaoyong6715
      @zhaoyong6715 ปีที่แล้ว

      finally got it to run after hours on it [as of 2023 18 feb]
      here are the steps I took
      On Ananconda Navigator
      Create a new environment and keep python version between 3.7 - 3.8 (somehow 3.9 had issues )
      Once done, within Ananconda Navigator , install these packages in the following order :
      pystan
      prophet
      Somehow I keep running into version error whenever I did pip install prophet
      hope this help :)

  • @heflindev
    @heflindev 3 ปีที่แล้ว

    Great tutorial.

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +1

      Thank you very much. Really glad you like it :-)

  • @jaiprathapgv2273
    @jaiprathapgv2273 3 ปีที่แล้ว +1

    Sir, I have another doubt. Why we are getting error when we don't add two columns ds and y?

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +1

      Hi mate, this is just due to the fact that the Prophet module requires this input. It is defined within the library.
      Check out this link:
      facebook.github.io/prophet/docs/quick_start.html
      quote:
      'The input to Prophet is always a dataframe with two columns: ds and y. The ds (datestamp) column should be of a format expected by Pandas, ideally YYYY-MM-DD for a date or YYYY-MM-DD HH:MM:SS for a timestamp. The y column must be numeric, and represents the measurement we wish to forecast.'

    • @jaiprathapgv2273
      @jaiprathapgv2273 3 ปีที่แล้ว +1

      @@Algovibes thank you so much

  • @tlghnkck
    @tlghnkck 2 ปีที่แล้ว +1

    Hello, when I apply this software to indices (SP500, XU100), the graphic below is broken. What would be the reason. The same error occurs in parities such as (EURUSD, GBPUSD).

    • @Algovibes
      @Algovibes  2 ปีที่แล้ว +1

      Been a long time since I played around with fbprophet. Ad hoc I would have no idea.

    • @tlghnkck
      @tlghnkck 2 ปีที่แล้ว

      @@Algovibes So can you also make a video of yourself for long-term stocks?

  • @jaiprathapgv2273
    @jaiprathapgv2273 3 ปีที่แล้ว +1

    Sir, How should I predict the value of the stock on a particular date?

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว

      Hi mate, thanks for watching :-)
      You can screen the forecast data frame for the date you are interested in. I am going a bit more into details in the newer one on fbprophet. Be kindly invited to check that out:
      th-cam.com/video/JTD-DSmxfq8/w-d-xo.html
      Let me know if that has solved you question.
      Best regards

    • @jaiprathapgv2273
      @jaiprathapgv2273 3 ปีที่แล้ว +1

      @@Algovibes it had helped me.

    • @jaiprathapgv2273
      @jaiprathapgv2273 3 ปีที่แล้ว +1

      @@Algovibes I like your videos. Can you post videos on using Data science in business fields? Sir, is it possible for you to tutor me in this field?

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +1

      @@jaiprathapgv2273 Regarding your first question: Sure I am trying to cover such things with all my videos - if you have a specific topic you are interested in let me know. I am just only talking about stuff which at least in my self evaluation I know what I am talking about :)
      Regarding the second one: I am trying to tutor by providing videos. Right now I am not able to offer one on one tutoring but might be in the future. I am kindly asking for your understanding until then.

  • @sigmaakhil9990
    @sigmaakhil9990 2 ปีที่แล้ว

    Sir...I got error in installing FbProphet... please help

    • @sigmaakhil9990
      @sigmaakhil9990 2 ปีที่แล้ว

      Solving environment like msgs here

  • @imtim1243
    @imtim1243 3 ปีที่แล้ว

    Hello, why can’t I just simply type “pip install fbprophet” on Jupyter notebook? I could not install neither Pystan nor fbprophet, plz help

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +1

      you actually can!
      Where is the problem occurring?

    • @imtim1243
      @imtim1243 3 ปีที่แล้ว

      @@Algovibes “ERROR: Command error Ed out with exit status 1”, as well as a warning regarding my pip version. Btw, I love your videos and hope you can make some more.

    • @imtim1243
      @imtim1243 3 ปีที่แล้ว

      @@Algovibes it show requirements are satisfied but I am unable to install and import the library. I couldn’t find it when I use help(“modules”)

    • @Algovibes
      @Algovibes  3 ปีที่แล้ว +2

      Please try this:
      pip install pystan==2.19.1.1
      then
      pip install fbprophet
      Let me know if this is solving your problem.

    • @imtim1243
      @imtim1243 3 ปีที่แล้ว

      @@Algovibes I could install pystan now, but when I installing fbprophet, it shows "
      ERROR: Command errored out with exit status 1:
      command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-install-vv_an01f/fbprophet_738cfd526a9c4f1cb92d0501147e092c/setup.py'"'"'; __file__='"'"'/private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-install-vv_an01f/fbprophet_738cfd526a9c4f1cb92d0501147e092c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'
      '"'"', '"'"'
      '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-record-zuvrzcq5/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/fbprophet
      cwd: /private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-install-vv_an01f/fbprophet_738cfd526a9c4f1cb92d0501147e092c/
      Complete output (9 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/fbprophet
      creating build/lib/fbprophet/stan_model
      INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
      ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-install-vv_an01f/fbprophet_738cfd526a9c4f1cb92d0501147e092c/setup.py'"'"'; __file__='"'"'/private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-install-vv_an01f/fbprophet_738cfd526a9c4f1cb92d0501147e092c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'
      '"'"', '"'"'
      '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n_/dlf2w9p17_dfb_qd0fp_9tr80000gn/T/pip-record-zuvrzcq5/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/fbprophet Check the logs for full command output."

  • @mohammadsalvatore7851
    @mohammadsalvatore7851 3 ปีที่แล้ว +1

    hello
    I have problem with model.fit(df)
    this is the problem :
    INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
    ---------------------------------------------------------------------------
    KeyError Traceback (most recent call last)
    KeyError: 'metric_file'
    then the kernal restarts

    • @Algovibes
      @Algovibes  2 ปีที่แล้ว

      Sorry for my late reply. I have just seen it. Were you able to solve it? It is most probably because of your pystan version.