Forecasting Covid19 Cases in USA & India with R | Facebook's Prophet Library for Time Series Data

Поделиться
HTML-код
  • Опубликовано: 12 дек 2024

Комментарии • 156

  • @ShubhamKumar-xy6kj
    @ShubhamKumar-xy6kj 4 года назад +1

    Sir,
    Internet is flooded with Data Science
    materials,but none of it can match your standard. You keep things simple.
    Your can make any one fall in love with data.

    • @bkrai
      @bkrai  4 года назад

      Thanks for your comments!

  • @statisticalworld1133
    @statisticalworld1133 4 года назад +1

    Interesting Dr. Bharatendra Rai... Sir I appreciated your lectures..It's very simple and informative. Thanks again.

    • @bkrai
      @bkrai  4 года назад

      You are most welcome!

  • @vitorklein
    @vitorklein 4 года назад +1

    We were already missing your wonderful videos. Cheers from Brazil.

    • @bkrai
      @bkrai  4 года назад

      Thanks for comments!

  • @lucaspeng675
    @lucaspeng675 4 года назад +1

    Greetings from China. Thank you Dr.Rai!!

    • @bkrai
      @bkrai  4 года назад

      You're most welcome!

  • @darktemplar2827
    @darktemplar2827 4 года назад +2

    This is great Dr. I am apply the codes on data for East Africa. Thank you so much

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @DnyaneshwarPanchaldsp
    @DnyaneshwarPanchaldsp 4 года назад +1

    Nice session 💐💐💐💐👌👌

    • @bkrai
      @bkrai  4 года назад

      Thanks!

  • @kaushikswaroop1569
    @kaushikswaroop1569 4 года назад +1

    Your videos are really great. Don't stop it anytime ,keep posting more videos♥️

    • @bkrai
      @bkrai  4 года назад

      Thank you so much!!

  • @daeyeolchang3610
    @daeyeolchang3610 4 года назад +2

    Dr, thank you for the great video. I have a quick question. Do you think it is available to use the method of video while predicting the response variable is not value, but percent change from baseline? (e.g, -10%, 20%, -15%, etc.)

    • @bkrai
      @bkrai  4 года назад +1

      That should work fine.

  • @stelluspereira
    @stelluspereira 4 года назад +1

    Thankyou Dr Rai

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @subhamoypatra468
    @subhamoypatra468 4 года назад +1

    Thank you sir for using Prophet.

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @bubu_numnums
    @bubu_numnums 4 года назад +1

    This video is super awesome! Thank you so much for your efforts. BTW, I like your other videos as well!

    • @bkrai
      @bkrai  4 года назад

      thanks for comments!

  • @mwahmed9519
    @mwahmed9519 4 года назад +1

    Excellent work....Much Appreciated....Thanks

    • @bkrai
      @bkrai  4 года назад

      Thanks for comments!

  • @akashprabhakar6353
    @akashprabhakar6353 4 года назад +1

    Sir could u pls explain these 2 lines...
    pred

    • @bkrai
      @bkrai  4 года назад +1

      If you run str(forecast), it will show you what's inside. And yhat is one of the column that contains predictions. Similarly, 'm' contains lot of info too and we are selecting something that we need.

  • @foodieengineer1649
    @foodieengineer1649 4 года назад +1

    Which is the better model arima or prophet ? How we decide which model to pick?

    • @bkrai
      @bkrai  4 года назад +1

      I've used R-sq, but other metrics such as rmse is also popular.

  • @mo8144
    @mo8144 4 года назад +1

    Thank you sir and you are the best 👍

    • @bkrai
      @bkrai  4 года назад

      Thanks for comments!

  • @guscilikhendi8712
    @guscilikhendi8712 4 года назад +1

    Dr. Bharatendra Rai please help me with this : Error in library(covid19.analytics) :
    there is no package called ‘covid19.analytics’

    • @bkrai
      @bkrai  4 года назад +1

      You need to first install that package and then run the library line.

    • @guscilikhendi8712
      @guscilikhendi8712 4 года назад

      @@bkrai "package covid19.analytics was removed from CRAN respiratory.

  • @ravikumar-vr6zm
    @ravikumar-vr6zm 4 года назад +1

    awesome Sir...

    • @bkrai
      @bkrai  4 года назад

      Thanks a ton!

  • @nawab1992
    @nawab1992 4 года назад +1

    Hello Sir,
    I am not able to use prophet function & make_future_dataframe from prophet package(while using prophet function, I am getting this: Error in prophet(df) : could not find function "prophet"

    • @bkrai
      @bkrai  4 года назад

      Make sure to run library(prophet)

    • @nawab1992
      @nawab1992 4 года назад +1

      I did sir, but could not find both the functions. Is any other package required to install before the prophet?

    • @bkrai
      @bkrai  4 года назад

      If package is installed properly, then probably look for any typo in the codes.

  • @AlokPratapSingh4001
    @AlokPratapSingh4001 4 года назад +2

    Thank you Sir. I am learning too much things. 🙏🙏🙏
    Sir, please make a tutorial for forecasting the number of cases using polynomial equation instead of linear, I think it would be more accurate in this scenario. am i correct, sir?

    • @bkrai
      @bkrai  4 года назад

      Thanks for the suggestion! However, note that the accuracy also depends on data and sources that generate data. This is a very powerful method and you can also improve accuracy by making some small adjustments to the model.

  • @morning_startarun584
    @morning_startarun584 4 года назад +2

    Sir
    Can you make a video on machine learning for covid 19 prediction (polynomial regression)

    • @bkrai
      @bkrai  4 года назад +1

      Thanks for the suggestion, I'm adding this to my list.

    • @morning_startarun584
      @morning_startarun584 4 года назад +1

      Thank you sir

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @trucngo7391
    @trucngo7391 4 года назад +1

    Hello sir, How can I make forecast accuracy for this prophet model?

    • @bkrai
      @bkrai  4 года назад +1

      You can use R-sq used in this video.

  • @josinajoy24
    @josinajoy24 4 года назад +1

    Thank You Sir for this great video. :)

    • @bkrai
      @bkrai  4 года назад

      Most welcome!

  • @srinivasdeevi405
    @srinivasdeevi405 4 года назад +1

    Thank you very much sir .. we are learning a lot by following your videos.. it would be great if you can share the code too for learners to practice 🙏

    • @bkrai
      @bkrai  4 года назад

      The link should now be available in the description area.

    • @srinivasdeevi405
      @srinivasdeevi405 4 года назад +1

      Thankyou sir..

    • @bkrai
      @bkrai  4 года назад

      welcome!

  • @omkar_salkar6729
    @omkar_salkar6729 3 года назад +1

    Sir which deep learning algorithm is used in this project?

    • @bkrai
      @bkrai  3 года назад

      It was not deep learning, but forecasting here.

  • @nilpipra
    @nilpipra 4 года назад +1

    when I put str(tsc) my Confirmed column shows as factor but in your it shows character. Do you have any thoughts why its is different
    than yours?

    • @bkrai
      @bkrai  4 года назад

      As long as you can covert them to numeric, it should be ok.

  • @dalmyjohn123
    @dalmyjohn123 4 года назад +1

    sir whenever I try to run this step
    "plot(actual, pred)
    I am getting an error
    Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ
    what to do sir

    • @bkrai
      @bkrai  4 года назад

      Make sure number of data points in actual and pred are same.

    • @dalmyjohn123
      @dalmyjohn123 4 года назад +1

      @@bkrai Ya that was the mistake, thank you sir

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @saumyagupta5907
    @saumyagupta5907 4 года назад +1

    Sir I m facing error in covid19.analytics library
    readRDS(nsInfoFilePath) : unknown input format
    Can you help me out.

    • @bkrai
      @bkrai  4 года назад +1

      You can run this:
      install.packages("covid19.analytics")

    • @saumyagupta5907
      @saumyagupta5907 4 года назад

      Sir it still showing same error
      Package or namespace load failed for ' covid19.analytics' in readRDS(nsInfoFilePath):
      Unknown input format.

  • @nohaamr9741
    @nohaamr9741 4 года назад +1

    Dr. when i plot the predicted data the Y is in format 0e+00 1e+06 although i checked the structure it's numeric as i converted it as you said so what might be the problem?

    • @bkrai
      @bkrai  4 года назад +1

      1e+06 is 1000000, it just more compact notation.

  • @akashprabhakar6353
    @akashprabhakar6353 4 года назад +2

    Thanks for the video sir..
    Why do we use Country.Region = "US" to get US specific data...when the column names is Country_Region

    • @bkrai
      @bkrai  4 года назад +1

      If you look into tsc before extracting just US related info, you will see that it contains data from across the world. If we only want a specific country, we can do it by specifying Country.Region = "US".

    • @akashprabhakar6353
      @akashprabhakar6353 4 года назад +1

      @@bkrai thanks for replying sir...My question was a bit different...
      Since the column names are Country_Region....Then how are we getting output on using Country.Region( '.' Instead of '_') ...

    • @bkrai
      @bkrai  4 года назад +1

      If you look at View(tsc), column name is Country.Region

  • @saadaljanabi4024
    @saadaljanabi4024 4 года назад +1

    excuse me sir when I run this codes this error appear 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.
    how can i solve this problem?

    • @bkrai
      @bkrai  4 года назад +1

      Probably there are missing values. What data are you using?

  • @maheshreddynimmala5795
    @maheshreddynimmala5795 4 года назад +1

    Sir I have one request from my side can we have forecast model on GARCH algorithm

    • @bkrai
      @bkrai  4 года назад +1

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

  • @littledancelover2962
    @littledancelover2962 4 года назад +1

    Sir I have to show these plots in UI using shiny.
    Any help will be appreciable

    • @bkrai
      @bkrai  4 года назад

      I'll do a video on Shiny later, meanwhile you can use this:
      ruclips.net/video/_a4S4tq62OE/видео.html

  • @willie0302
    @willie0302 4 года назад +1

    sir, how can you use multi countries in one graph rather than one country one graph?

    • @bkrai
      @bkrai  4 года назад

      You can try ggplot2 for multi plots:
      ruclips.net/video/fWolE0lxND8/видео.html

  • @varuntirupati2566
    @varuntirupati2566 4 года назад +1

    sir, how you got the data can you please give me the source link

    • @bkrai
      @bkrai  4 года назад

      You can run this:
      install.packages("covid19.analytics")

  • @thalaramji3777
    @thalaramji3777 4 года назад +1

    Tq sir

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @soniarajput872
    @soniarajput872 4 года назад +1

    Can anyone please help me how do I install prophet package in R ?? It says its not available for R version 3.3.2

    • @bkrai
      @bkrai  4 года назад +1

      You can try it from RStudio cloud:
      ruclips.net/video/SFpzr21Pavg/видео.html

    • @soniarajput872
      @soniarajput872 4 года назад

      @@bkrai Thank you so much for your reply and the link Dr. Bharatendra. Really appreciate it and you are doing a great work! Hats off to you!

  • @pradeepamila3380
    @pradeepamila3380 4 года назад +1

    sir, i installed the package(prophet) but when i run the package error comes and show that there is no package called prophet, how can i solve this?

    • @bkrai
      @bkrai  4 года назад +1

      Make sure to run library(prophet) too.

  • @shilanjoybhattacharjee1534
    @shilanjoybhattacharjee1534 4 года назад +1

    Sir I had question on GAN.
    Suppose I have 25 images with me , how many new images can I generate from them using GAN.

    • @bkrai
      @bkrai  4 года назад +1

      Note that 25 is a very small sample, but once GAN can be trained, there is no limit on how many you can generate.

    • @shilanjoybhattacharjee1534
      @shilanjoybhattacharjee1534 4 года назад +1

      @@bkrai But the generated data would be redundant. I guess.

    • @bkrai
      @bkrai  4 года назад +1

      The new images are all likely to be slightly different from each other.

    • @shilanjoybhattacharjee1534
      @shilanjoybhattacharjee1534 4 года назад +1

      @@bkrai I will try it and get back to you , Thank you so much Sir.

    • @bkrai
      @bkrai  4 года назад +1

      Welcome!

  • @dr.wazihahmad786
    @dr.wazihahmad786 4 года назад +1

    sir can u please check your script is not working currently

    • @bkrai
      @bkrai  4 года назад

      Which line in the video is not working?

  • @indhujamuthukumar911
    @indhujamuthukumar911 4 года назад +1

    Sir, how to calculate rmse value for the model?

    • @bkrai
      @bkrai  4 года назад +1

      You can use this:
      ruclips.net/video/rV-hhKBRKbI/видео.html

    • @indhujamuthukumar911
      @indhujamuthukumar911 4 года назад

      @@bkrai Thanks much, sir!

  • @nandiniramesh261
    @nandiniramesh261 4 года назад +1

    Can someone help me with this...
    "Error in prophet(ds, y) : could not find function Prophet"

    • @bkrai
      @bkrai  4 года назад

      Make sure you run library(prophet) line.

    • @nandiniramesh261
      @nandiniramesh261 4 года назад +1

      @@bkrai yeah i did it but still getting the error

    • @bkrai
      @bkrai  4 года назад

      Send code to look at, there may be some typo.

    • @nandiniramesh261
      @nandiniramesh261 4 года назад +1

      # Libraries
      library(covid19.analytics)
      library(dplyr)
      library(prophet)
      library(lubridate)
      library(ggplot2)
      #Data
      data

    • @bkrai
      @bkrai  4 года назад

      I just now ran your codes. They run fine.

  • @chiragsharma4606
    @chiragsharma4606 4 года назад +1

    sir how can I export all files (50 - 100 ) in CSV formate in a folder without writing script again and again?

    • @bkrai
      @bkrai  4 года назад

      You can make use of write.csv function to export any data as csv. Note that the data are likely to change on a daily basis due to updates.

    • @chiragsharma4606
      @chiragsharma4606 4 года назад

      @@bkrai sir I know this function and I use this but there are 100 files that I want to export at the same time in the folder. is there any way that I could export them together?

  • @maheshreddynimmala5795
    @maheshreddynimmala5795 4 года назад +1

    Sir when Ur going upload the video of GARCH MODEL SIR

    • @bkrai
      @bkrai  4 года назад

      Hopefully soon :)

  • @abhinavsinha7423
    @abhinavsinha7423 4 года назад +1

    $ operator is invalid for atomic vectors-----plz help to solve this

    • @bkrai
      @bkrai  4 года назад

      Which line of code has this issue?

    • @abhinavsinha7423
      @abhinavsinha7423 4 года назад +1

      @@bkrai I had made some mistake. After checking it properly, the code worked. Thanks anyways.

    • @bkrai
      @bkrai  4 года назад

      Thanks for the update!

  • @Nirajkumar-wy1up
    @Nirajkumar-wy1up 4 года назад +1

    Hello sir, pattern of my qplot is different from yours...what could be the reason?

    • @bkrai
      @bkrai  4 года назад

      This data gets updated daily, so the plot is likely to change with new data.

    • @deepakpant5716
      @deepakpant5716 4 года назад +1

      @@bkrai sir i think problem in here
      tsc$Date

    • @josinajoy24
      @josinajoy24 4 года назад +1

      @@deepakpant5716 Hi,I too had this problem .In my case "Confirmed" variable was factor.I tried to convert it into numeric using "as.numeric" command,datatype changed to numeric but got different plot and new "Confirmed" values were different from actual.Then I tried the following commands:
      tsc$Confirmed

    • @bkrai
      @bkrai  4 года назад

      Thanks for the update!

    • @yusei527
      @yusei527 4 года назад +2

      Josina Joy I had the same issue, too!! Thank you so much!!

  • @rishikeshchakraborty8415
    @rishikeshchakraborty8415 4 года назад +1

    i got some unusual pattern when i try to qpolt( ) ,why this thing is happening ???

    • @bkrai
      @bkrai  4 года назад

      Make sure the second variable is converted to numeric.

  • @praveenparmar7728
    @praveenparmar7728 4 года назад +1

    dyplot.prophet(m, forecast) is not working using 100% CPU Memory

    • @bkrai
      @bkrai  4 года назад

      You can try rstudio cloud which works independent of the computer:
      ruclips.net/video/SFpzr21Pavg/видео.html

  • @rajasekhar9927
    @rajasekhar9927 4 года назад +1

    Great video !! Can I get the data file?

    • @bkrai
      @bkrai  4 года назад +1

      Data is available from within R. For more info refer to this link:
      ruclips.net/video/ytIZqSaKb3w/видео.html

    • @rajasekhar9927
      @rajasekhar9927 4 года назад +1

      @@bkrai Thank you for the reply !!

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @sk93359
    @sk93359 4 года назад +1

    Sir please make a video to read muliple file using r and process one bye one using function to find key
    If key ="parent" in whole file to serch this in all file and make a data frame for each filename of text

    • @sk93359
      @sk93359 4 года назад

      If you need text file i will give you please send me own email id
      Or please mail me sunil342it@gmail.com

    • @bkrai
      @bkrai  4 года назад +1

      I think you are looking to do something similar to the link below at about 16:40 time point. There we are reading several files containing images, but you can easily do it for a csv file too.
      ruclips.net/video/5bso_5X7Zu4/видео.html

    • @sk93359
      @sk93359 4 года назад +1

      @@bkrai thanks sir this is usefull for me Your Greet🙏
      But please make a video for ML model to Serching key from text file like if many text file contain your name "Dr.B Rai" then make a model to predict your name from text file

    • @bkrai
      @bkrai  4 года назад +1

      Ok, thanks I'm adding it to my list

  • @riteshtripathi8626
    @riteshtripathi8626 4 года назад +1

    sir, my date is in format: X1.22.20
    How can I convert this to actual dates?

    • @bkrai
      @bkrai  4 года назад

      Which one is year, month and day?

    • @riteshtripathi8626
      @riteshtripathi8626 4 года назад +1

      @@bkrai Sir,
      1: Month
      22: Date
      20: Year

    • @bkrai
      @bkrai  4 года назад

      What is "X" then?

    • @riteshtripathi8626
      @riteshtripathi8626 4 года назад +1

      @@bkrai sir, X is with in the column names,
      for eg, my column names are as follows:
      first column name: Province.State
      Second Column name: Country.Region
      Third Col name: Lat
      Fourth Col name: Long
      Fifth Col name: X1.22.20
      Sixth Col name: X1.23.20 and so on..
      My Date columns are not like how its shown in your video: (2020-01-22)

    • @bkrai
      @bkrai  4 года назад

      If your date is '1.23.20', you can do something like this:
      a

  • @balakrishna5711
    @balakrishna5711 4 года назад +1

    prophet (), is throwing an error sir

    • @bkrai
      @bkrai  4 года назад

      Between prophet and (), remove space.

  • @morning_startarun584
    @morning_startarun584 4 года назад +1

    # prediction
    Future

    • @bkrai
      @bkrai  4 года назад

      You can click on forecast in the 3rd window to see all.

  • @maheshreddynimmala5795
    @maheshreddynimmala5795 4 года назад +1

    Sir I need GARCH model can have a video in one day sir. This my request sir

    • @bkrai
      @bkrai  4 года назад

      Thanks, I've added it to my list.

    • @bkrai
      @bkrai  4 года назад

      You can find 1st of the 4 about garch here:
      ruclips.net/video/9OVleScSjKs/видео.html

    • @maheshreddynimmala5795
      @maheshreddynimmala5795 4 года назад +1

      TQ sir

    • @bkrai
      @bkrai  4 года назад

      welcome!