{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"<h1><center><span style=\"color:blue\">Time Series Based Analysis and Forecasting </span></center></h1>","metadata":{}},{"cell_type":"markdown","source":"<h3> <span style=\"color:orange\">Table of Contents</span></h3>","metadata":{}},{"cell_type":"markdown","source":"1. Introduction \n2. Libraries Used \n3. ARIMA Model Forecasting \n4. LSTM Model Forecasting \n5. Model Comparisons \n6. Conclusion \n7. Future Work\n8. References\n","metadata":{}},{"cell_type":"markdown","source":"<h3 align = \"center\"> Introduction </h3>","metadata":{}},{"cell_type":"markdown","source":"Functionally, time series is described as a set of random variables measured against time. In machine learning it can have various roles, such as, identifying the components of a trend and making predictions based on it. It represents a series of time-based orders. The unit of measurement could be as huge as a decade or as small as a second. It is considered to be an observation of the sequence of discrete time of successive intervals. \n\n<h3 align = \"center\"> Meaning of Time Series and Forecasting: </h3>\n\n‘Time Series’ describes our graphical output of the predictions made on the dataset. Forecasting means using statistics and modeling to generate predictions from our given dataset.\n<img src=\"https://www.springboard.com/blog/wp-content/uploads/2022/09/time-series-forecasting-overview.png\"  width=\"400\" height=\"400\" align = \"center\">\n\n\n\n\n\n\n<h3 align = \"center\"> History: </h3>\n\nEarly machine learning in time series dates back to the mid 1900s. In 1969, researchers explored the idea of combining forecasts to enhance their performances and bring out the best models. \nIn the late 1980s, machine learning enthusiasts proposed various new methods of utilizing this domain, some examples being:\n - Anomaly detection - to identify intrusions in a network\n - Dynamic time warping - used to measure the similarity of time series \n - Recursive neural networks - to extract useful patterns from corrupted data\n <img src=\" https://www.researchgate.net/profile/Mohsin-Munir/publication/333448095/figure/fig2/AS:763831148109829@1559122945986/Forecasting-and-anomaly-detection-results-of-FuseAD-on-the-TS11-time-series-from-the_W640.jpg\"  width=\"400\" height=\"400\" align = \"center\">\n\n\n\n<h3 align = \"center\"> Progress: </h3>\n\nNowadays, Time Series and Forecasting is a part of almost every aspect of life. From economics to medicine, we observe it in almost every possible field. We have come up with several models, algorithms to discover the most accurate method for our projects. In our code, we have made the use of ARIMA (AutoRegressive Integrated Moving Average) and LSTM (Long Short-Term Memory)\n <img src=\"https://av-eks-blogoptimized.s3.amazonaws.com/39815Components%20of%20Time%20Series%20Analysis.png\"  width=\"400\" height=\"400\" align = \"center\">\n\n\n<h3 align = \"center\"> Our Project: </h3>\n\n- Topic: Number of estimated submissions per year\n\n- Dataset: https://www.kaggle.com/datasets/kaggle/meta-kaggle\n\n- Logic:\nPreprocess the Data Using EDA (Exploratory Data Analysis) , analyze the text , find the frequency of words and list them under top 10 most common words.\nPerform group by - competitions launch date vs count\n\n- Models Used:\n\n\n\n  - ARIMA\n\nA mathematical model that uses previous values to represent the time series values forms the basis of ARIMA. This concept is founded on two key components: \n\nPast Values: Past behavior is unquestionably a reliable indicator of future behavior. The only uncertainty is the appropriate number of historical values. The most recent p time series data are used as features in the model. In this case, p is a hyperparameter that must be chosen while creating the model.\n\nPast Mistakes: The model can benefit from the knowledge of its past performance levels. As a result, we include the model's most recent q mistakes as features. Q is a hyperparameter once more.   \nThis situation calls for the time series to be standardized to make the model independent of seasonal or cyclical tendencies. To put it formally, we want the model to be trained on a stationary time series. In its most basic form, stationarity refers to the absence of change in the statistical characteristics of a process producing a time series.\n\nIn our code, ARIMA is used to: \n- Change the datatype according to our model \n- Get the forecast by inserting this modified data\n- Plot the same to analyze our predicted results - actual vs forecast\n        \n\n  - LSTM \n \nThe basic goal of LSTM cells is to remember the crucial portions of the sequence that have already been seen while forgetting the less crucial ones. This is accomplished by the so-called gates, or functions with various learning goals, such as, a concise description of the time series that has been observed thus far, together with information on how to mix new data with the series' historical representation and what information to ignore. \n\nIn our code, LSTM is used to:\n\n - Prepare and normalize the data\n - Split into Test and Train sets\n - Prepare the training data and reshape it \n - Build the LSTM model\n - Train the model\n - Prepare the test data and perform predictions on it \n - Trim the data and predictions to the required length\n - Visualize the forecast","metadata":{}},{"cell_type":"markdown","source":"Import the necessary library - nltk\n\n- download stopwords - for list of common stop words\n\n- download punkt - for tokenizing text into words or sentences\n\n- download vader_lexicon - for lexicon to utilize in sentiment analysis","metadata":{}},{"cell_type":"code","source":"import nltk\nnltk.download('stopwords')","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2023-07-04T17:25:54.992612Z","iopub.execute_input":"2023-07-04T17:25:54.993076Z","iopub.status.idle":"2023-07-04T17:25:56.604003Z","shell.execute_reply.started":"2023-07-04T17:25:54.993043Z","shell.execute_reply":"2023-07-04T17:25:56.601808Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nltk.download('punkt')","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:56.606163Z","iopub.execute_input":"2023-07-04T17:25:56.606536Z","iopub.status.idle":"2023-07-04T17:25:56.710046Z","shell.execute_reply.started":"2023-07-04T17:25:56.606504Z","shell.execute_reply":"2023-07-04T17:25:56.708931Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nltk.download('vader_lexicon')","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:56.711532Z","iopub.execute_input":"2023-07-04T17:25:56.712674Z","iopub.status.idle":"2023-07-04T17:25:56.722980Z","shell.execute_reply.started":"2023-07-04T17:25:56.712621Z","shell.execute_reply":"2023-07-04T17:25:56.721849Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"1) Read the kaggle writeups csv file\n\n2) Check the dimensions of the dataset\n\n3) Plot the set of number of competitions launched vs year\n\n4) Analyse the text\n\n   - store list of stop words in english\n   \n   - preprocess the text by tokenizing it\n   \n   - apply the preprocessing to the writeup and extract top 10 most common words observed\n   \n   - analyse the sentiment of the text\n   \n5) For Time Series Forecasting, groupby competition launch date and count\n\n6) Use ARIMA model to forecast the data\n","metadata":{}},{"cell_type":"markdown","source":"Firstly, all the necessay libraries are imported, as shown below:","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nfrom nltk.stem import PorterStemmer\nfrom nltk.sentiment import SentimentIntensityAnalyzer\nfrom statsmodels.tsa.arima.model import ARIMA","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:56.725887Z","iopub.execute_input":"2023-07-04T17:25:56.727086Z","iopub.status.idle":"2023-07-04T17:25:57.444832Z","shell.execute_reply.started":"2023-07-04T17:25:56.727037Z","shell.execute_reply":"2023-07-04T17:25:57.443821Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Next, we load the given data as depicted:","metadata":{}},{"cell_type":"code","source":"# Step 1: Load the data\ndf = pd.read_csv(\"/kaggle/input/2023-kaggle-ai-report/kaggle_writeups_20230510.csv\")","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.446328Z","iopub.execute_input":"2023-07-04T17:25:57.447321Z","iopub.status.idle":"2023-07-04T17:25:57.885510Z","shell.execute_reply.started":"2023-07-04T17:25:57.447272Z","shell.execute_reply":"2023-07-04T17:25:57.884457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Now, we perform the Exploratory Data Analysis (EDA):","metadata":{}},{"cell_type":"code","source":"# Step 2: Exploratory Data Analysis (EDA)\n# Check dimensions of the dataset\nprint(\"Dataset Dimensions:\", df.shape)","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.887412Z","iopub.execute_input":"2023-07-04T17:25:57.888231Z","iopub.status.idle":"2023-07-04T17:25:57.894740Z","shell.execute_reply.started":"2023-07-04T17:25:57.888185Z","shell.execute_reply":"2023-07-04T17:25:57.893457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.896813Z","iopub.execute_input":"2023-07-04T17:25:57.897136Z","iopub.status.idle":"2023-07-04T17:25:57.931708Z","shell.execute_reply.started":"2023-07-04T17:25:57.897109Z","shell.execute_reply":"2023-07-04T17:25:57.930438Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df=df.dropna()","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.933246Z","iopub.execute_input":"2023-07-04T17:25:57.933647Z","iopub.status.idle":"2023-07-04T17:25:57.952427Z","shell.execute_reply.started":"2023-07-04T17:25:57.933612Z","shell.execute_reply":"2023-07-04T17:25:57.950838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.954199Z","iopub.execute_input":"2023-07-04T17:25:57.954587Z","iopub.status.idle":"2023-07-04T17:25:57.977083Z","shell.execute_reply.started":"2023-07-04T17:25:57.954556Z","shell.execute_reply":"2023-07-04T17:25:57.975854Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Explore competition launch dates\ndf['Competition Launch Date'] = pd.to_datetime(df['Competition Launch Date'])\ndf['Year'] = df['Competition Launch Date'].dt.year\ncompetition_counts = df['Year'].value_counts().sort_index()\nplt.plot(competition_counts.index, competition_counts.values)\nplt.xlabel('Year')\nplt.ylabel('Number of Competitions')\nplt.title('Number of Competitions Launched Over Time')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:57.981681Z","iopub.execute_input":"2023-07-04T17:25:57.982322Z","iopub.status.idle":"2023-07-04T17:25:58.417615Z","shell.execute_reply.started":"2023-07-04T17:25:57.982288Z","shell.execute_reply":"2023-07-04T17:25:58.416524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Through our initial analysis, we observe that there are a total of 3127 records, with 2 missing values for the 'Writeup' column. Since, 2 is a really small number as compared to the total number of records, we drop the 2 null values. Then, we explore the launch dates to build our foundation for the analysis. Variable competition_counts stored the year of the competition. plt.plot was used to plot the data. We then proceeded to label the x and y axes. The plot gave us a count of number of competitions over time. We can see that, the number of competitions increased significantly from the year 2016 and currently in the year 2023 it is still being monitored. \n","metadata":{}},{"cell_type":"code","source":"# Step 3: Text Data Analysis\n# Preprocessing\nstop_words = set(stopwords.words('english'))\nstemmer = PorterStemmer()\n\ndef preprocess_text(text):\n    if pd.isnull(text) or isinstance(text, float):\n        return ''\n    tokens = word_tokenize(text.lower())\n    tokens = [stemmer.stem(token) for token in tokens if token.isalnum() and token not in stop_words]\n    return ' '.join(tokens)\n\ndf['Processed Writeup'] = df['Writeup'].apply(preprocess_text)","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:25:58.418922Z","iopub.execute_input":"2023-07-04T17:25:58.419270Z","iopub.status.idle":"2023-07-04T17:27:06.035918Z","shell.execute_reply.started":"2023-07-04T17:25:58.419242Z","shell.execute_reply":"2023-07-04T17:27:06.034351Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The above is for textual analysis: stop_words is a set of all stop words in english (for example, ‘and’).  stemmer  \nfinds the root for similar words. Function preprocess_text is  used on the text. ps.isnull() checks for empty strings/ null values. Tokens received from word_tokenize are stored in the variable tokens and returned. The function is then applied to the Writeup","metadata":{}},{"cell_type":"code","source":"# Frequency analysis\nword_freq = pd.Series(' '.join(df['Processed Writeup']).split()).value_counts()[:10]\nplt.bar(word_freq.index, word_freq.values)\nplt.xlabel('Words')\nplt.ylabel('Frequency')\nplt.title('Top 10 Most Common Words in Writeups')\nplt.show()\n\n# Sentiment analysis\nsid = SentimentIntensityAnalyzer()\ndf['Sentiment'] = df['Writeup'].apply(lambda x: sid.polarity_scores(str(x))['compound'])\n","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:06.037873Z","iopub.execute_input":"2023-07-04T17:27:06.038363Z","iopub.status.idle":"2023-07-04T17:27:36.904179Z","shell.execute_reply.started":"2023-07-04T17:27:06.038319Z","shell.execute_reply":"2023-07-04T17:27:36.902926Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Through the above plot, it is evident that some of the most common words in the submissions are pertaining to 'http','model','train','code' and 'featur'. At first glance, we note that the competitions are usually inclined towards something to do with web application, model training and feature analysis.","metadata":{}},{"cell_type":"markdown","source":"Now, on our given data we apply time series forecasting, to predict how many competitions might be held in the future.","metadata":{}},{"cell_type":"markdown","source":"<h3> Model 1: ARIMA </h3>","metadata":{}},{"cell_type":"code","source":"# Step 4: Time Series Forecasting\n# Assuming \"Competition Launch Date\" as the time-related variable\ntime_series = df.groupby('Competition Launch Date').size().reset_index(name='Count')\ntime_series = time_series.set_index('Competition Launch Date')\n\n# ARIMA forecasting\nmodel = ARIMA(time_series['Count'], order=(1, 1, 1))\nmodel_fit = model.fit()\nforecast_start = time_series.index.max() + pd.DateOffset(days=1)\nforecast_end = forecast_start + pd.DateOffset(days=190)\nforecast_index = pd.date_range(start=forecast_start, end=forecast_end, freq='D')\nforecast = model_fit.get_forecast(steps=len(forecast_index)).predicted_mean\n","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:36.905740Z","iopub.execute_input":"2023-07-04T17:27:36.906321Z","iopub.status.idle":"2023-07-04T17:27:37.070655Z","shell.execute_reply.started":"2023-07-04T17:27:36.906278Z","shell.execute_reply":"2023-07-04T17:27:37.069315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Time Series ForeCasting - time_series groups by competition launch date and sets index to count. ","metadata":{}},{"cell_type":"markdown","source":"ARIMA forecasting:\n- model - initializes ARIMA model object\n- model_fit - fits the model to the data\n- forecast_start - determines start date for forecast\n- forecast_end - determines end date for forecast\n- forecast_index - creates data range from start to end\n- predicted_mean - contains forecasted values\n","metadata":{}},{"cell_type":"markdown","source":"Display the forecast","metadata":{}},{"cell_type":"code","source":"forecast","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:37.072770Z","iopub.execute_input":"2023-07-04T17:27:37.073651Z","iopub.status.idle":"2023-07-04T17:27:37.086143Z","shell.execute_reply.started":"2023-07-04T17:27:37.073606Z","shell.execute_reply":"2023-07-04T17:27:37.084746Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Plot the time series data - Date vs Count","metadata":{}},{"cell_type":"code","source":"plt.plot(time_series.index, time_series['Count'], label='Actual')\nplt.plot(forecast_index, forecast, label='Forecast')\nplt.xlabel('Date')\nplt.ylabel('Count')\nplt.title('Time Series Forecasting')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:37.088767Z","iopub.execute_input":"2023-07-04T17:27:37.089779Z","iopub.status.idle":"2023-07-04T17:27:37.502181Z","shell.execute_reply.started":"2023-07-04T17:27:37.089711Z","shell.execute_reply":"2023-07-04T17:27:37.501202Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h3> Model 2: LSTM </h3>","metadata":{}},{"cell_type":"code","source":"!pip install tensorflow keras","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:37.503303Z","iopub.execute_input":"2023-07-04T17:27:37.504689Z","iopub.status.idle":"2023-07-04T17:27:52.843538Z","shell.execute_reply.started":"2023-07-04T17:27:37.504641Z","shell.execute_reply":"2023-07-04T17:27:52.842161Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"1) Import libraries - pandas, numpy , matplotlib, keras and sklearn\n\n2) To perform time series forecasting using LSTM we will follo the belo steps:\n\n     - format the data\n     \n     - normalize using scaler\n     \n     - split into test and train sets\n     \n     - prepare training data\n     \n     - build LSTM model\n     \n     - train the model on train set\n     \n     - prepare test data\n     \n     - use it for predictions\n     \n     - trim test data accordingly\n     \n     - plot the forecast\n     ","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler\nfrom keras.models import Sequential\nfrom keras.layers import LSTM, Dense\n\n# Step 4: Time Series Forecasting using LSTM\n# Prepare the data\ntime_series['Count'] = time_series['Count'].astype(float)\ndata = time_series['Count'].values.reshape(-1, 1)\n\n# Normalize the data\nscaler = MinMaxScaler(feature_range=(0, 1))\ndata_scaled = scaler.fit_transform(data)\n\n# Split the data into train and test sets\ntrain_size = int(len(data_scaled) * 0.8)\ntrain_data = data_scaled[:train_size]\ntest_data = data_scaled[train_size:]\n\n# Prepare the training data\nlook_back = 7  # Number of previous time steps to use for prediction\nX_train, y_train = [], []\nfor i in range(len(train_data) - look_back):\n    X_train.append(train_data[i:i + look_back, 0])\n    y_train.append(train_data[i + look_back, 0])\nX_train, y_train = np.array(X_train), np.array(y_train)\nX_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))\n\n# Build the LSTM model\nmodel = Sequential()\nmodel.add(LSTM(units=50, return_sequences=True, input_shape=(X_train.shape[1], 1)))\nmodel.add(LSTM(units=50))\nmodel.add(Dense(units=1))\nmodel.compile(optimizer='adam', loss='mean_squared_error')\n\n# Train the model\nmodel.fit(X_train, y_train, epochs=100, batch_size=16)\n\n# Prepare the test data\ninputs = data_scaled[len(data_scaled) - len(test_data) - look_back:]\nX_test = []\nfor i in range(look_back, len(inputs)):\n    X_test.append(inputs[i - look_back:i, 0])\nX_test = np.array(X_test)\nX_test = np.reshape(X_test, (X_test.shape[0], X_test.shape[1], 1))\n\n# Make predictions on the test data\npredictions = model.predict(X_test)\npredictions = scaler.inverse_transform(predictions)\n\n\n# Trim the test_data and predictions to match the length of time_series\ntest_data_trimmed = test_data[:len(predictions)]\ntime_series_trimmed = time_series[train_size + look_back:train_size + look_back + len(predictions)]\n\n# Create a range of indices for the x-axis\nx_axis = range(len(predictions))\n\n# Visualize the forecast\nplt.plot(x_axis, test_data_trimmed, label='Actual')\nplt.plot(x_axis, predictions, label='Forecast')\nplt.xlabel('Index')\nplt.ylabel('Count')\nplt.title('LSTM Time Series Forecasting')\nplt.legend()\nplt.show()\n\n\n","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:27:52.845334Z","iopub.execute_input":"2023-07-04T17:27:52.845709Z","iopub.status.idle":"2023-07-04T17:28:21.071617Z","shell.execute_reply.started":"2023-07-04T17:27:52.845673Z","shell.execute_reply":"2023-07-04T17:28:21.070440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"1) Convert the forecastes dates to dataframe\n\n2) Visualize it ","metadata":{}},{"cell_type":"code","source":"# Convert the forecasted dates to a pandas DateTimeIndex\nforecast_dates = pd.date_range(start=time_series.index[train_size + look_back], periods=len(predictions), freq='D')\n\n# Visualize the forecast\nplt.plot(forecast_dates, test_data[:len(predictions)], label='Actual')\nplt.plot(forecast_dates, predictions, label='Forecast')\nplt.xlabel('Date')\nplt.ylabel('Count')\nplt.title('LSTM Time Series Forecasting')\nplt.legend()\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-07-04T17:28:21.073209Z","iopub.execute_input":"2023-07-04T17:28:21.074114Z","iopub.status.idle":"2023-07-04T17:28:21.509310Z","shell.execute_reply.started":"2023-07-04T17:28:21.074073Z","shell.execute_reply":"2023-07-04T17:28:21.507929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The code starts to exexute by data preparation. It converts the 'Count' column in the 'time_series' DataFrame to float and reshapes it. Once this transformation is done, normalization is applied on the data using MinMaxScaler to ensure it falls within the range of 0 to 1. Next, train - test split is done on the data, with 80% for training data and 20% for testing data. In training data, the input sequences and corresponding target values are created based on a specified look-back period. The LSTM model is implemented using Keras library, consisting of two LSTM layers and a dense output layer. The optimizer used for the training data is Adam optimizer and mean squared error loss function. For testing data, input sequences are prepared for the test data. This model makes a prediction for the target values for the test data, which are further transformed back to the original scale. The test data and predictions are then shrortened to match the length of the original time series data. Finally, the forecasted and actual values are visualized.","metadata":{}},{"cell_type":"markdown","source":"<h3><center><span style=\"color:black\">Conclusion </span></center></h3>\n\nIn conclusion, we have demonstrated how two time series forecasting models: LSTM and ARIMA, can predict complex patterns within the given data. While we do not get a high accuracy which could be because of limited data points each of these models have their advantages and drawbacks. LSTM excels in capturing long-term dependencies and ARIMA provides a more interpretable framework. By the help of these models, ew have gained certain significant insights and can be more prepared as to what we can expect in the future.\n","metadata":{}},{"cell_type":"markdown","source":"<h3><center><span style=\"color:black\">Future Work</span></center></h3>\n\nWhile we have covered forecasting based on LSTM and ARIMA, during our research, we also came across a new model called “Prophet” which is a forecasting model developed by Facebook's Data Science team. It captures the seasonality, trends, and holiday effects in the data by combining the strengths of additive decomposition models and generalized additive models (GAMs). This model takes care of domain-specific knowledge and provides automated changepoint detection, making it a significant tool for forecasting.\n\n\n\nThe progress of Time Series Analysis has been instrumental to the fields of Artificial Intelligence and Data Science. The integration of analysis with algorithms has enhanced predictions, making them more robust and accurate. We have seen a significant rise in the quality of anomaly detection, decision making, and many other problems that require pattern recognition. Additionally, hybrid models which combine deep learning and time series forecasting yield better and more reliable results. Exploration and interpretation of time series models will be crucial in building trust in technology. Futhermore, this helps in giving more personalized results. Overall, this is a very promising domain and it continues to shape the landscape of systems across diverse industries.\n","metadata":{}},{"cell_type":"markdown","source":"<h3><center> References </center></h3>","metadata":{}},{"cell_type":"markdown","source":"- R. H. Shumway and D. S. Stoffer, \"Time Series Analysis and Its Applications,\" in IEEE Signal Processing Magazine, Nov. 1997, doi: 10.1109/79.641978.\n- D. C. Montgomery, C. L. Jennings and M. Kulahci, \"Introduction to Time Series Analysis and Forecasting,\" in IEEE Potentials, March-April 2015, doi: 10.1109/MPOT.2014.2377582.\n- 'ARIMA vs Prophet vs LSTM for Time Series Prediction', Neptune.ai, https://neptune.ai/blog/arima-vs-prophet-vs-lstm (Apr 28, 2022)\n- A. Nielsen, Oreilly, 'Practical Time Series Analysis by Aileen Nielsen', https://www.oreilly.com/library/view/practical-time-series/9781492041641/ch01.html (Jun 29, 2022)\n- F. Yu, 'A Thorough Guide to Time Series Analysis', towardsdatascience, https://towardsdatascience.com/a-thorough-guide-to-time-series-analysis-5439c63bc9c5 (May 24, 2022)\n- M. Pietro, 'Time Series Analysis for Machine Learning', towardsdatascience https://towardsdatascience.com/time-series-analysis-for-machine-learning-with-python-626bee0d0205 (Sep 20,2022)","metadata":{}}]}