Forecasting Time Series Data in R | Facebook's Prophet Package 2017 & Tom Brady's Wikipedia data

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 161

  • @mingdepang384
    @mingdepang384 5 років тому +3

    Thank you so much! I did it! Actually, I have an assignment about time series prediction which I have never touched before and this assignment is determining whether I could get this job. Now I got it after following your step, thank you so much!

    • @bkrai
      @bkrai  5 років тому

      Good to know, congrats!

  • @surbhiagrawal3951
    @surbhiagrawal3951 4 роки тому +1

    Your knowledge level is superb sir

    • @bkrai
      @bkrai  4 роки тому

      Thanks for comments!

  • @shadyjii2154
    @shadyjii2154 5 років тому +1

    Tested it today 2019/10/30 and some minor differences, for instance it plotted the time of day the page was most active, also the 'count' variable was missing, so I used 'views' and it got to basically the same results. Thanks for all these great RStudio videos.

    • @bkrai
      @bkrai  5 років тому +1

      Thanks for the update!

  • @gernelwalker2367
    @gernelwalker2367 3 роки тому +1

    Namaskaram. Amazing tutorial Dr. Bharatendra

    • @bkrai
      @bkrai  3 роки тому

      Thanks!

  • @ankonabanerjee1381
    @ankonabanerjee1381 5 років тому +1

    Excellent video. Special thanks to Dr. Rai for making these videos. God bless!!!!

    • @bkrai
      @bkrai  5 років тому

      Thanks for your comments!

  • @dimplepatel3722
    @dimplepatel3722 5 років тому +1

    Very good video with clear instruction step wise. Do yo have any video or information for forecasting using Random Forest model? Thank you.

    • @bkrai
      @bkrai  5 років тому

      Here is the link to random forest video: ua-cam.com/video/dJclNIN-TPo/v-deo.html

  • @robertpelzer5041
    @robertpelzer5041 2 роки тому +1

    thank you very much for this fantastic explanation. greetings from germany!

    • @bkrai
      @bkrai  2 роки тому

      You're very welcome!

  • @aphiwemagaya3279
    @aphiwemagaya3279 3 роки тому

    Can you please do a video whereby you demonstrate how one can do time series forecasting using KNN for both regression and classification :(

  • @saisrinivas17
    @saisrinivas17 4 роки тому +2

    I find this video really simple and excellent!

    • @bkrai
      @bkrai  4 роки тому

      Glad it was helpful!

  • @gauravpandeypgpm1739
    @gauravpandeypgpm1739 7 років тому +2

    Hi, this is the first video that demonstrates the workings of prophet, so thanks for that.
    Just a thought, I've been using prophet extensively for forecasting sales and more often than not it has disappointed me. I found its capabilities shine over other methods only in case when series is very ideal. Not sure if I'm missing something or it's actually a problem. Did you try prophet on any other complex series?
    Also, you did not split the dataset into test and train to calculate accuracy, any specific reason for that?

    • @bkrai
      @bkrai  5 років тому

      I'm seeing this comment today. But thanks for the feedback. It certainly has many good features, however I like trying several different options.

  • @godfreyjoseph9483
    @godfreyjoseph9483 2 роки тому +1

    Good lecture sir, how to differentiate the graph for Original and forecasted values?

    • @bkrai
      @bkrai  2 роки тому

      In the forecast there are no black dots representing actual values.

  • @AnalyticsMaster
    @AnalyticsMaster 6 років тому

    Thanks a lot for a nice explanation of the usage of prophet package. I have a question. If the data is not stationary, can we still continue building time series model using prophet (without making it stationary - as we do in arima model) ?

  • @GabrielGarcia90
    @GabrielGarcia90 4 роки тому +1

    Worked perfect for me. Thanks a lot for your time and doing this.

    • @bkrai
      @bkrai  4 роки тому

      Great to hear!

  • @sardakuar
    @sardakuar 6 років тому

    The wikipediatrend package currently has no server providing any page view information.
    Use package pageviews for recent (2016+) information.
    Older information hopefully available again soon.

  • @harishnagpal21
    @harishnagpal21 6 років тому

    Good stuff. Can we use this model to predict stock market index like SENXEX, NIFTY etc? One more query, if we want to add a variable like Govt. in power, ie we wd be having - Date, Senxex/Nifty closing index, Govt in power then how to go about that... thanks

  • @surbhiagrawal3951
    @surbhiagrawal3951 4 роки тому +1

    > prophet_plot_components(io,futdat)
    Error in FUN(X[[i]], ...) : object 'trend' not found

    • @bkrai
      @bkrai  4 роки тому

      I think you need to review previous line of codes.

  • @tekaerabo9163
    @tekaerabo9163 6 років тому

    it is nice, but I want to forecast DCC and BEKK models, any option to forecast them?

  • @sailalmishra4860
    @sailalmishra4860 6 років тому +2

    Sir,
    You are amazing as always. Don't know what to say. I wish i could thank you more and more. This actually is an amazing package by facebook and it worked like a gem. you are the living God. Salute to your content, expertise, precision, dedication. My role model. I aspire to pursue my career as a data scientist in near future. Need your blessings and guidance. Do revert if you see my message, please. Thanks a lot Guru Ji.

    • @bkrai
      @bkrai  6 років тому

      Thanks for your comments and very best wishes!

    • @sailalmishra4860
      @sailalmishra4860 6 років тому +1

      really made my day.. thank a ton..

  • @movie4dilip
    @movie4dilip 4 роки тому +1

    Thank you. How can we predict for multiple players? Suppose we have counts for 10 players for the given period then how to do it.

    • @bkrai
      @bkrai  4 роки тому

      Once you have complete code, you can easily do it for any number of players.

  • @ravindarmadishetty736
    @ravindarmadishetty736 7 місяців тому

    Hi Sir, Can you please help me? I have one categorical exogenous column which contains 3 fields in it. I am trying to forecast using SARIMAX with R Code. Requesting you to please do refer some links or material?

  • @glanegons
    @glanegons 4 роки тому +1

    i'm getting this error Error in setup_dataframe(m, history, initialize_scales = TRUE) :
    Unable to parse date format in column ds. Convert to date format (%Y-%m-%d or %Y-%m-%d %H:%M:%S) and check that there are no NAs. after using prophet(df) , can u suggest?

    • @bkrai
      @bkrai  4 роки тому

      It says 'check that there are no NAs'. Make sure there are no missing data.

  • @theREstd
    @theREstd 6 років тому +2

    Hello sir,
    Nice explanation..I have a question . Lets say we are forecasting for number of units sold in an inventory and as there will be many products is there any specific package that can be used to forecast on each product or should we use a for loop??
    Thank you

    • @bkrai
      @bkrai  6 років тому

      I would suggest use 'for' loop.

  • @Bhaveshwari21
    @Bhaveshwari21 3 роки тому

    Can u pass the parameter and based on parameter selection, can we predict the value? So we will get overall next 365 days prediction or based on some attribute selection seperately

  • @blakeviolette8691
    @blakeviolette8691 4 роки тому +1

    Hello, this is a great video! I am stuck on the package install of prophet, there is no package with that name when I search. Do you know if that package is still available today (2020-04-23). thank you!

    • @bkrai
      @bkrai  4 роки тому +2

      It seems it was removed recently. Hopefully it will be back soon with updates.

    • @mubangansofu7469
      @mubangansofu7469 4 роки тому

      Hi Blake. Go to cran and download the package from here cran.r-project.org/web/packages/prophet/index.html then install by pointing to your download folder. I managed to install it using this method and did the whole turtorial

    • @manasarath
      @manasarath 4 роки тому

      @@mubangansofu7469 Hi, I downloaded the source file for the package but unable to install it. Is there some resource I could use to install by pointing out the downloaded folder?

  • @MsHhff
    @MsHhff 5 років тому +1

    Hello sir,
    Great video, very well explained! I have a question
    .
    I have daily data. When I apply m = prophet (df), on my console doesn't appear STAN OPTIMIZATION COMMAND.
    Please help me in this issue. Thank you

    • @bkrai
      @bkrai  5 років тому +1

      These packages under go changes from time to time. If now it doesn't show that note, that's fine. As long as you are not getting error, its ok.

    • @MsHhff
      @MsHhff 5 років тому

      @@bkrai Thank for your comments! It's really useful!

  • @surbhiagrawal3951
    @surbhiagrawal3951 4 роки тому +1

    > plot(io,futdat)
    Error in FUN(X[[i]], ...) : object 'yhat' not found. This error is beign generated

    • @bkrai
      @bkrai  4 роки тому

      Are you using same data?

  • @monamona2056
    @monamona2056 4 роки тому +1

    Thank you for your efforts...please guide me regarding the forecasting of exchange rates...is it follow the same package and method or there is a need to install another package

    • @bkrai
      @bkrai  4 роки тому

      It should work fine. You can refer to time-series related playlist below for more examples:
      ua-cam.com/video/OJ3aeVBHAIk/v-deo.html

  • @nik0096
    @nik0096 5 років тому

    I have tried using with my data and my y values are more than 50,000 in most of the cases and the yhat doesn't cross even 9 ( log of 9 is 8k). I think I am doing something wrong here but I just don't know what.

  • @nickdodson9370
    @nickdodson9370 6 років тому +4

    Page View R code: data

  • @dingaroo2003
    @dingaroo2003 7 років тому +1

    As of 10th October 2017, the data is no longer available.

  • @syedhamzajamil4490
    @syedhamzajamil4490 3 роки тому +1

    Sir how ,we can use two or three columns for multivariate forecasting using Facebook Prophet

    • @bkrai
      @bkrai  3 роки тому +1

      here is the link:
      ua-cam.com/video/sA0OqK6Mwc4/v-deo.html

  • @neerajraut6473
    @neerajraut6473 6 років тому +1

    why did u use log for count variable? and when exactly do we have to apply log function?

    • @bkrai
      @bkrai  6 років тому +1

      In the video I showed using plots how log helps to see the patterns. But if you have data where without log transformation, patterns are clearly visible, then you don't need it.

  • @ericjohnson1811
    @ericjohnson1811 6 років тому +1

    Excellent video. Thanks for posting!

    • @bkrai
      @bkrai  6 років тому

      Thanks for comments!

  • @devawratvidhate9093
    @devawratvidhate9093 5 років тому +2

    can we use prophet package to predict stock prices ...?

    • @bkrai
      @bkrai  5 років тому

      yes, it should work fine.

  • @mohammedalmashraie4035
    @mohammedalmashraie4035 7 років тому +1

    Great video. How do I get performance measures?
    like MAPE, AIC, MSE ...

    • @bkrai
      @bkrai  7 років тому

      you should be able to calculate them easily using y and yhat values.

  • @amitgeneration
    @amitgeneration 4 роки тому +1

    Hi Sir,
    what forecasting method will best work if the data is at weekly level. like below
    Jan 2, 2012
    Jan 9, 2012
    Jan 16, 2012
    Jan 23, 2012
    ...
    Mar 17, 2014
    Mar 24, 2014
    Mar 31, 2014
    or do i have to change first into Time series before starting with a forecasting model. Need your urgent help sir.

    • @bkrai
      @bkrai  4 роки тому +1

      It should work fine. Let me know if you get any error.

    • @bkrai
      @bkrai  4 роки тому +1

      You may also refer to this:
      ua-cam.com/play/PL34t5iLfZddt9X6Q6aq0H38gn-_JQ1RjS.html

    • @amitgeneration
      @amitgeneration 4 роки тому +1

      @@bkrai Sure !! Thanks a lot Sir

    • @bkrai
      @bkrai  4 роки тому

      Welcome!

  • @saimanohar3363
    @saimanohar3363 6 років тому +2

    Nice video. Sir could you please upload a video on how to forecast the dependent variable given other independent variables over time in R. Thanks

    • @bkrai
      @bkrai  6 років тому

      Thanks for the suggestion!

  • @DnyaneshwarPanchaldsp
    @DnyaneshwarPanchaldsp 4 роки тому +1

    Can I use this library for any type of website e.g. healthcare related

    • @bkrai
      @bkrai  4 роки тому

      Yes, it will work with any time series data.

  • @akkimalhotra26
    @akkimalhotra26 7 років тому

    dear sir, what is r shiny. can we collaborate all these data sets and code with r shiny package. is it another way of doing r programming
    thankyou

  • @ahmedhossain7771
    @ahmedhossain7771 4 роки тому +1

    Can I use monthly data in Prophet model, please let me know.

    • @bkrai
      @bkrai  4 роки тому +1

      Yes, that should work fine.

  • @vikrantnag86
    @vikrantnag86 6 років тому +1

    Thanks Sir for this video, It will be really good if you can make one video series on Time series forecasting techniques like ARIMA, ETS.

    • @bkrai
      @bkrai  6 років тому

      Thanks for the suggestion, I've added this to my list.

  • @Tkn_famjam
    @Tkn_famjam 5 років тому +1

    Sir... How to replace negative value because in my dataset will have negative values instead of 0

    • @bkrai
      @bkrai  5 років тому

      But time cannot be negative.

  • @parasrai145
    @parasrai145 6 років тому +2

    Great video, very well explained!

    • @bkrai
      @bkrai  6 років тому

      Thanks for comments!

  • @juanurrego796
    @juanurrego796 7 років тому

    I want to create a data frame of covariates in order to be able to use the predict function. However, to use the predict function, I must include all my variables in this new data frame, which seems really hard because I have a variable that identifies countries by name. I've tried using the following code:
    data_for_fitted_values3

  • @harshithreddy2462
    @harshithreddy2462 6 років тому

    Hello sir, how to create time-series with hourly frequency(for ex : start from 25-12-2012 00:00 to 31-12-2012 09:00) please let me know

  • @MrIRBee
    @MrIRBee 7 років тому +2

    Thanks, really useful. Great package.

  • @randulajayasinghe8237
    @randulajayasinghe8237 4 роки тому +1

    Sir, how to get the forecasting model accuracy?

    • @bkrai
      @bkrai  4 роки тому

      You may refer to this link for more details:
      ua-cam.com/play/PL34t5iLfZdduRvHafEKM6vrDmfnlUfzAy.html

  • @harishnagpal21
    @harishnagpal21 6 років тому

    which one to use in normal condition ie - Facebook's Prophet or R' time series object ts and 'forecast' package

  • @machinelearningzone.6230
    @machinelearningzone.6230 5 років тому +1

    Thanks for the video,an informative introduction to the 'Prophet' package.It would be helpful if your code is available.

    • @bkrai
      @bkrai  5 років тому

      I did this two years back and unfortunately cannot locate the code that I used.

  • @avinashparashar1622
    @avinashparashar1622 6 років тому

    Hi,
    When i am trying to call package prophet the i am getting an error message.
    Error: package or namespace load failed for ‘prophet’:
    .onLoad failed in loadNamespace() for 'prophet', details:
    call: compileCode(f, code, language = language, verbose = verbose)
    error: Compilation ERROR, function(s)/method(s) not created! Warning message:
    In system(cmd) : 'make' not found
    In addition: Warning messages:
    1: In system2(file.path(Sys.getenv("R_HOME"), "bin", Sys.getenv("R_ARCH_BIN"), :
    running command '"C:/Users/AVINAS~1.PAR/DOCUME~1/R/R-35~1.1/bin//R" CMD config CXX' had status 1
    2: In system(cmd, intern = !verbose) :
    running command 'C:/Users/AVINAS~1.PAR/DOCUME~1/R/R-35~1.1/bin/i386/R CMD SHLIB file241c6a7b2342.cpp 2> file241c6a7b2342.cpp.err.txt' had status 1
    And it is not allowing me to use function make_future_dataframe.
    Could you please tell me what is going wrong?

    • @bkrai
      @bkrai  6 років тому

      You can try installing it again after restarting RStudio.

  • @suduzz
    @suduzz 3 роки тому +1

    Great video

    • @bkrai
      @bkrai  3 роки тому

      Thanks for comments!

  • @brunopedemonte4210
    @brunopedemonte4210 6 років тому

    If I want to forecast a Linear/Lasso/XGBoost model, how I can fit it in the code?

    • @bkrai
      @bkrai  6 років тому

      You can find them in this link:
      ua-cam.com/play/PL34t5iLfZddu8M0jd7pjSVUjvjBOBdYZ1.html

  • @TeeCeezz
    @TeeCeezz 7 років тому +2

    very well explained... great video!

    • @bkrai
      @bkrai  7 років тому

      thanks!

    • @TeeCeezz
      @TeeCeezz 7 років тому

      one quick question.. if I want to include day of week feature for prediction.. how do I do that?

    • @bkrai
      @bkrai  7 років тому

      when you provide day/month/year data, the package already takes care of day of the week. The chart towards the end of the video has seasonality index plotted by day of the week.

  • @mdsaifulislam5891
    @mdsaifulislam5891 5 років тому +1

    Awesome sir. Thank you

    • @bkrai
      @bkrai  5 років тому +1

      Thanks!

  • @civer28kex
    @civer28kex 6 років тому

    I have this error, can you tell me what I have wrong?
    Error in arrange_impl(.data, dots) :
    Evaluation error: object 'ds' not found.
    In addition: Warning message:
    In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'

    • @civer28kex
      @civer28kex 6 років тому

      The error occurs when I apply the function prophet

  • @merumomo
    @merumomo 7 років тому

    Can you show me plotting moving average as well as time series plot?

  • @ronsingh19
    @ronsingh19 7 років тому +2

    Good explanation!

  • @tungstonhill928
    @tungstonhill928 6 років тому

    Does anyone know how to fix this problem?
    install.packages('Prophet',repos='cran.us.r-project.org')
    Installing package into ‘/Users/Brent/Library/R/3.2/library’
    (as ‘lib’ is unspecified)
    Warning in install.packages :
    package ‘Prophet’ is not available (for R version 3.2.1)

  • @owl571
    @owl571 6 років тому +1

    Awesome, thanks for sharing.

    • @bkrai
      @bkrai  6 років тому

      Thanks for feedback!

  • @poojachaudhary4156
    @poojachaudhary4156 7 років тому

    Hello sir
    How can I can get accuracy parameter like AIC ,BIC etc when I have some test data and foretasted data from prophet model ?
    Thanks

    • @bkrai
      @bkrai  7 років тому +1

      You can refer to the package documentation for more details: cran.r-project.org/web/packages/prophet/prophet.pdf
      If the package doesn't provide AIC, BIC, etc., you may have to do it based on output obtained.

    • @poojachaudhary4156
      @poojachaudhary4156 7 років тому

      Thank you for your reply sir , but can you please tell me that how can I get AIC (or other accuracy parameter ) by test (y) and foretasted (y hat) ?
      As for every model we have to compare that How this model is better than any other model (Like Holt-winter , ARIMA, Prophet )
      What will be the comparison key here ?

  • @sandeepmane8694
    @sandeepmane8694 4 роки тому +1

    Because without data we can't get out put properly

    • @bkrai
      @bkrai  4 роки тому

      Not sure what you are looking for.

  • @krishnamishra8598
    @krishnamishra8598 5 років тому +1

    Sir please make video on ARIMA model

    • @bkrai
      @bkrai  5 років тому

      Thanks, I've added it to my list.

  • @merumomo
    @merumomo 7 років тому +2

    Liked this video!

  • @tungstonhill928
    @tungstonhill928 6 років тому

    How do you do it with a date on the y axis

    • @bkrai
      @bkrai  6 років тому

      If you are doing time series plot. I would suggest keep time on x-axis. But if you are just looking to plot a x-axis variable on y-axis, try this link:
      ua-cam.com/video/niB5A8qa88I/v-deo.html

  • @soumenchatterjee9774
    @soumenchatterjee9774 3 роки тому +1

    Can you kindly share the code file ?

    • @bkrai
      @bkrai  3 роки тому

      You can use the link below this video:
      ua-cam.com/video/yGLK1VthM2M/v-deo.html

  • @DocworldAcademy
    @DocworldAcademy 7 років тому +2

    Thanks for this video

  • @akshayaraghunandhan639
    @akshayaraghunandhan639 5 років тому +1

    can you send me the dataset and r-code as well.

    • @bkrai
      @bkrai  5 років тому +1

      I'm not able to locate r file, but for data some students informed me wikipediatrend is not working and suggested this:
      install.packages("pageviews") library(pageviews) data

    • @bkrai
      @bkrai  5 років тому +1

      You can also try:
      Page View R code: data

  • @amplewarrior1923
    @amplewarrior1923 4 роки тому +1

    I was already stuck on line 13 when I mistook the q for a g

    • @bkrai
      @bkrai  4 роки тому

      Hope you resolved it.

  • @vivekdixit1045
    @vivekdixit1045 4 роки тому +1

    Thanks Sir 👍

    • @bkrai
      @bkrai  4 роки тому +1

      Welcome!

  • @netmarketer77
    @netmarketer77 6 років тому

    Thanks Bharat for all useful videos.
    Can I ask a question? In a dataset:
    www.stat.ufl.edu/~winner/data/clotthes_expend.csv
    How can i find the estimated order for AR and MA? Any one can help?
    Thanks.

  • @dheepakg3633
    @dheepakg3633 2 роки тому +1

    Amazing

    • @bkrai
      @bkrai  2 роки тому

      Thanks!

  • @ashishjain6119
    @ashishjain6119 7 років тому +2

    too fast..but good insight in 12 minutes

  • @srinirao7725
    @srinirao7725 4 роки тому +1

    Thank you

    • @bkrai
      @bkrai  4 роки тому

      You're welcome!

  • @sparkyarch
    @sparkyarch 6 років тому +1

    install.packages("wikipediatrend")

  • @bensonadesida7404
    @bensonadesida7404 7 років тому

    Please am getting this when i run wp_trend
    rror in curl::curl_fetch_memory(url, handle = handle) :
    Timeout was reached
    In addition: Warning message:
    In value[[3L]](cond) : [wp_jsons_to_df()]
    Could not extract data from server response. Data for one month will be missing.
    stats.grok.se/json/en/201406/Tom_Brady
    data from server was: Error in curl::curl_fetch_memory(url, handle = handle) :
    Timeout was reac

    • @AdrianHeinUY
      @AdrianHeinUY 7 років тому

      I have the same issue, trying to access stats.grok.se/json/en/201301/Tom_Brady

    • @AdrianHeinUY
      @AdrianHeinUY 7 років тому

      according to en.wikipedia.org/wiki/Wikipedia:Pageview_statistics the site stats.grok.se is down and the new pageview analysis site contains only data back to July 1, 2015

    • @nishitgarg2899
      @nishitgarg2899 7 років тому

      getting the same error

  • @DnyaneshwarPanchaldsp
    @DnyaneshwarPanchaldsp 4 роки тому +1

    💐💐👌👌

    • @bkrai
      @bkrai  4 роки тому

      Thanks!

  • @anandparwatikar1176
    @anandparwatikar1176 5 років тому

    Sir, i have month;y data. How to use this package for monthly data ? and get monthly predictions?

  • @harshithreddy2462
    @harshithreddy2462 6 років тому

    Hello sir, how to create a TIME-SERIES of hourly data?
    (ex from 25-12-2012 00:00 to 31-12-2012 09:00) please help me out

  • @ailu53
    @ailu53 5 років тому +1

    Hello sir,
    How can we prove our model accuracy (from prophet library).
    Please help me in this issue.
    Thank you.

    • @bkrai
      @bkrai  5 років тому

      You can find RMSE or R-Square values to assess model performance.