{"id":24257,"date":"2023-05-22T11:30:56","date_gmt":"2023-05-22T08:00:56","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/chatgpt-unplugged-empowering-developer-for-documentation-2a6o\/"},"modified":"2023-05-22T11:30:56","modified_gmt":"2023-05-22T08:00:56","slug":"chatgpt-unplugged-empowering-developer-for-documentation-2a6o","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/chatgpt-unplugged-empowering-developer-for-documentation-2a6o\/","title":{"rendered":"ChatGPT Unplugged: \u062a\u0648\u0627\u0646\u0645\u0646\u062f\u0633\u0627\u0632\u06cc \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u0647 \u0628\u0631\u0627\u06cc \u0645\u0633\u062a\u0646\u062f\u0627\u062a"},"content":{"rendered":"<div data-article-id=\"1473380\" id=\"article-body\">\n<p><strong>\u0645\u0642\u062f\u0645\u0647<\/strong>:<br \/>\u0627\u06cc\u0646 \u0627\u0641\u0633\u0627\u0646\u0647 \u06a9\u0647 &#8220;\u0647\u06cc\u0686 \u0633\u0646\u062f\u06cc \u062f\u0631 Agile \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f&#8221; \u062f\u0642\u06cc\u0642 \u0646\u06cc\u0633\u062a.  \u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 Agile \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u06a9\u0627\u0631 \u0631\u0627 \u062f\u0631 \u0627\u0648\u0644\u0648\u06cc\u062a \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u062f\u060c \u0627\u0631\u0632\u0634 \u0627\u0633\u0646\u0627\u062f \u0631\u0627 \u062a\u0634\u062e\u06cc\u0635 \u0645\u06cc \u062f\u0647\u062f.  Agile \u0627\u0633\u0646\u0627\u062f \u0633\u0628\u06a9 \u0648\u0632\u0646 \u0648 \u0627\u0646\u0639\u0637\u0627\u0641 \u067e\u0630\u06cc\u0631\u06cc \u0631\u0627 \u062a\u0631\u0648\u06cc\u062c \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u0627\u0632 \u0647\u0645\u06a9\u0627\u0631\u06cc \u0648 \u0627\u0631\u062a\u0628\u0627\u0637 \u062f\u0631 \u062a\u06cc\u0645 \u0648 \u0628\u0627 \u0633\u0647\u0627\u0645\u062f\u0627\u0631\u0627\u0646 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0645\u06cc \u06a9\u0646\u062f.  \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u062f\u0631 \u0637\u0648\u0644 \u0641\u0631\u0622\u06cc\u0646\u062f Agile \u0628\u0627 \u062a\u0645\u0631\u06a9\u0632 \u0628\u0631 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0647\u0645 \u0648 \u062a\u06a9\u0627\u0645\u0644 \u0628\u0627 \u0645\u062d\u0635\u0648\u0644 \u06cc\u06a9\u067e\u0627\u0631\u0686\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a.  \u0627\u06cc\u0646 \u0645\u0633\u0626\u0648\u0644\u06cc\u062a \u0645\u0634\u062a\u0631\u06a9 \u062a\u06cc\u0645 Agile \u0627\u0633\u062a \u0648 \u062f\u0631 \u0635\u0648\u0631\u062a \u0646\u06cc\u0627\u0632 \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u0634\u0648\u062f\u060c \u0628\u0647 \u0637\u0648\u0631 \u0645\u06a9\u0631\u0631 \u0628\u0647 \u0631\u0648\u0632 \u0645\u06cc \u0634\u0648\u062f \u0648 \u0645\u0631\u062a\u0628\u0637 \u0646\u06af\u0647 \u062f\u0627\u0634\u062a\u0647 \u0645\u06cc \u0634\u0648\u062f. <\/p>\n<p><\/p>\n<p>\u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0622\u0632\u0645\u0627\u06cc\u0634 \u0627\u06cc\u0646 \u0628\u0648\u062f \u06a9\u0647 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u0645 \u0686\u06af\u0648\u0646\u0647 ChatGPT \u0628\u0627 \u0645\u0647\u0646\u062f\u0633\u06cc \u0633\u0631\u06cc\u0639 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u06af\u0627\u0646 \u06a9\u0645\u06a9 \u06a9\u0646\u062f \u062a\u0627 \u0628\u0627 \u06cc\u06a9 \u0646\u0633\u062e\u0647 \u067e\u0627\u06cc\u0647 \/ \u067e\u06cc\u0634\u200c\u0646\u0648\u06cc\u0633 \u0627\u0633\u0646\u0627\u062f \u0628\u0631\u0627\u06cc \u06a9\u062f\u06cc \u06a9\u0647 \u0646\u0648\u0634\u062a\u0647\u200c\u0627\u0646\u062f\u060c \u0633\u0631\u0639\u062a \u0628\u062e\u0634\u0646\u062f. <\/p>\n<p><strong>\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0628\u0631\u0627\u06cc \u0627\u0633\u0646\u0627\u062f \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631\u06cc<\/strong> <\/p>\n<div class=\"table-wrapper-paragraph\">\n<table>\n<thead>\n<tr>\n<th>\u0645\u0648\u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647<\/th>\n<th>\u062f\u0631\u062e\u0648\u0627\u0633\u062a GPT<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u0645\u0642\u062f\u0645\u0647 \u0627\u06cc \u0628\u0631 \u0628\u0631\u0646\u0627\u0645\u0647<\/td>\n<td>\u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u06a9\u0644\u0645\u0627\u062a \u0633\u0627\u062f\u0647 \u0628\u0631\u0627\u06cc \u0645\u0628\u062a\u062f\u06cc \u062a\u0648\u0636\u06cc\u062d \u062f\u0647\u06cc\u062f<\/td>\n<\/tr>\n<tr>\n<td>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0634\u062e\u0635\u0627\u062a \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631<\/td>\n<td>\u0628\u0631\u0627\u06cc \u062a\u0648\u0636\u06cc\u062d \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062f \u0628\u0627\u0644\u0627 \u06cc\u06a9 \u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0634\u062e\u0635\u0627\u062a \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f<\/td>\n<\/tr>\n<tr>\n<td>\u0646\u0645\u0648\u062f\u0627\u0631 \u062c\u0631\u06cc\u0627\u0646<\/td>\n<td>\u0644\u0637\u0641\u0627\u064b \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u0641\u0644\u0648\u0686\u0627\u0631\u062a \u062f\u0631 html mermaid \u0628\u0631\u0627\u06cc \u06a9\u062f \u0628\u0627\u0644\u0627 \u06a9\u0645\u06a9 \u06a9\u0646\u06cc\u062f<\/td>\n<\/tr>\n<tr>\n<td>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0631\u0646\u0627\u0645\u0647<\/td>\n<td>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0631\u0646\u0627\u0645\u0647 \u0639\u0644\u0627\u0645\u062a \u06af\u0630\u0627\u0631\u06cc HTML \u0628\u0631\u0627\u06cc \u06a9\u062f \u0628\u0627\u0644\u0627<\/td>\n<\/tr>\n<tr>\n<td>\u0646\u0648\u0634\u062a\u0646 \u0645\u0648\u0631\u062f \u062a\u0633\u062a<\/td>\n<td>\u0646\u0645\u0648\u0646\u0647 \u0622\u0632\u0645\u0627\u06cc\u0634\u06cc \u06a9\u062f \u0628\u0627\u0644\u0627 \u0631\u0627 \u062f\u0631 \u062c\u062f\u0648\u0644 \u0646\u0634\u0627\u0646\u0647 \u06af\u0630\u0627\u0631\u06cc \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f<\/td>\n<\/tr>\n<tr>\n<td>\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc \u062a\u0633\u062a \u0648\u0627\u062d\u062f \u0631\u0627 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f<\/td>\n<td>\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc \u0622\u0632\u0645\u0627\u06cc\u0634\u06cc \u0628\u0631\u0627\u06cc \u06a9\u062f \u0628\u0627\u0644\u0627 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><strong>\u0645\u0639\u0631\u0641\u06cc<\/strong>:<br \/><img decoding=\"async\" src=\"https:\/\/nabfollower.com\/blog\/wp-content\/uploads\/2023\/05\/1684742456_587_ChatGPT-Unplugged-\u062a\u0648\u0627\u0646\u0645\u0646\u062f\u0633\u0627\u0632\u06cc-\u062a\u0648\u0633\u0639\u0647-\u062f\u0647\u0646\u062f\u0647-\u0628\u0631\u0627\u06cc-\u0645\u0633\u062a\u0646\u062f\u0627\u062a.png\" alt=\"\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062a\u0635\u0648\u06cc\u0631\" loading=\"lazy\" width=\"800\" height=\"644\" title=\"\"><\/p>\n<p><strong>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0634\u062e\u0635\u0627\u062a \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631<\/strong>:<br \/><img decoding=\"async\" src=\"https:\/\/nabfollower.com\/blog\/wp-content\/uploads\/2023\/05\/1684742456_966_ChatGPT-Unplugged-\u062a\u0648\u0627\u0646\u0645\u0646\u062f\u0633\u0627\u0632\u06cc-\u062a\u0648\u0633\u0639\u0647-\u062f\u0647\u0646\u062f\u0647-\u0628\u0631\u0627\u06cc-\u0645\u0633\u062a\u0646\u062f\u0627\u062a.png\" alt=\"\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062a\u0635\u0648\u06cc\u0631\" loading=\"lazy\" width=\"800\" height=\"553\" title=\"\"><\/p>\n<p>\u0647\u0645\u06cc\u0634\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u0639\u0644\u0627\u0645\u062a \u06af\u0630\u0627\u0631\u06cc HTML \u0631\u0627 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0646\u062f:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;title&gt;Software Specification Document&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Software Specification Document&lt;\/h1&gt;\n\n    &lt;h2&gt;1. Introduction&lt;\/h2&gt;\n    &lt;p&gt;This document outlines the software specification for a Python program that performs time series analysis and forecasting using the Seasonal Autoregressive Integrated Moving Average (SARIMA) model. The program takes a dataset of monthly airline passenger numbers as input and provides various functionalities for data preprocessing, model fitting, forecasting, and evaluation.&lt;\/p&gt;\n\n    &lt;h2&gt;2. Purpose&lt;\/h2&gt;\n    &lt;p&gt;The purpose of this software is to assist in analyzing historical airline passenger data and generating forecasts for future periods. It automates the process of selecting the best SARIMA model based on the Akaike Information Criterion (AIC) and provides visualizations of the data, model diagnostics, and forecasted results.&lt;\/p&gt;\n\n    &lt;h2&gt;3. Functionality&lt;\/h2&gt;\n\n    &lt;h3&gt;3.1. Data Loading and Preprocessing&lt;\/h3&gt;\n    &lt;p&gt;The software offers functionality to load the input dataset from a CSV file and perform preprocessing steps to enhance data readability and usability. This includes converting the \"Month\" column to a datetime format and setting it as the index.&lt;\/p&gt;\n\n    &lt;h3&gt;3.2. Data Visualization&lt;\/h3&gt;\n    &lt;p&gt;The software provides visualization capabilities to plot the loaded data as a time series graph, visualizing the monthly airline passenger numbers over time. Users can configure plot settings, such as figure size, font size, and plot style, for optimal visualization.&lt;\/p&gt;\n\n    &lt;h3&gt;3.3. Model Selection&lt;\/h3&gt;\n    &lt;p&gt;The software generates all possible combinations of SARIMA model parameters based on predefined ranges for the order and seasonal_order parameters. It fits each model to the training data and calculates the AIC. Finally, it identifies the SARIMA model with the lowest AIC as the best-fit model.&lt;\/p&gt;\n\n    &lt;h3&gt;3.4. Model Diagnostics&lt;\/h3&gt;\n    &lt;p&gt;The software provides visual diagnostics of the best-fit SARIMA model, including plots for residuals, histogram, and normal Q-Q plot. These diagnostics help users assess the goodness of fit for the selected model.&lt;\/p&gt;\n\n    &lt;h3&gt;3.5. Forecasting&lt;\/h3&gt;\n    &lt;p&gt;The software enables users to generate one-step-ahead and dynamic forecasts using the best-fit SARIMA model. It also provides confidence intervals for the forecasts and projects future passenger numbers using the get_forecast method.&lt;\/p&gt;\n\n    &lt;h3&gt;3.6. Evaluation&lt;\/h3&gt;\n    &lt;p&gt;The software calculates the Mean Absolute Percentage Error (MAPE) to evaluate the accuracy of the forecasted results. It compares the forecasted values with the ground truth values from the test dataset.&lt;\/p&gt;\n\n    &lt;h2&gt;4. Input and Output&lt;\/h2&gt;\n    &lt;p&gt;&lt;strong&gt;Input:&lt;\/strong&gt; CSV file containing monthly airline passenger data.&lt;\/p&gt;\n    &lt;p&gt;&lt;strong&gt;Output:&lt;\/strong&gt; Graphical visualizations of the data, model diagnostics, and forecasted results. Additionally, the program prints the best-fit model parameters and the MAPE for the forecasted year.&lt;\/p&gt;\n\n    &lt;h2&gt;5. Dependencies&lt;\/h2&gt;\n    &lt;p&gt;The software requires the following dependencies:&lt;\/p&gt;\n    &lt;ul&gt;\n        &lt;li&gt;Python 3.x&lt;\/li&gt;\n        &lt;li&gt;pandas library for data manipulation&lt;\/li&gt;\n        &lt;li&gt;numpy library for numerical operations&lt;\/li&gt;\n        &lt;li&gt;matplotlib library for data visualization&lt;\/li&gt;\n        &lt;li&gt;statsmodels library for time series analysis&lt;\/li&gt;\n    &lt;\/ul&gt;\n\n    &lt;h2&gt;6. Usage&lt;\/h2&gt;\n    &lt;p&gt;To use the software, follow these steps:&lt;\/p&gt;\n    &lt;ol&gt;\n        &lt;li&gt;Ensure that Python and the required dependencies are installed on the system.&lt;\/li&gt;\n        &lt;li&gt;Place the input dataset file (\"international-airline-passengers.csv\") in the same directory as the program.&lt;\/li&gt;\n        &lt;li&gt;Run the program, which will load the data, perform preprocessing, and display the time series graph.&lt;\/li&gt;\n        &lt;li&gt;Examine the model diagnostics plots to assess the goodness of fit for the selected SARIMA model.&lt;\/li&gt;\n        &lt;li&gt;Review the forecasted results and their confidence intervals.&lt;\/li&gt;\n        &lt;li&gt;Note the best-fit SARIMA model parameters and the MAPE for the forecasted year.&lt;\/li&gt;\n    &lt;\/ol&gt;\n\n    &lt;h2&gt;7. Conclusion&lt;\/h2&gt;\n    &lt;p&gt;This software provides a convenient and automated way to analyze historical airline passenger data, select the best SARIMA model, generate forecasts, and evaluate their accuracy. It aims to assist users in making informed decisions based on time series analysis and forecasting results.&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>\u0646\u0645\u0648\u062f\u0627\u0631 \u062c\u0631\u06cc\u0627\u0646<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nabfollower.com\/blog\/wp-content\/uploads\/2023\/05\/1684742456_568_ChatGPT-Unplugged-\u062a\u0648\u0627\u0646\u0645\u0646\u062f\u0633\u0627\u0632\u06cc-\u062a\u0648\u0633\u0639\u0647-\u062f\u0647\u0646\u062f\u0647-\u0628\u0631\u0627\u06cc-\u0645\u0633\u062a\u0646\u062f\u0627\u062a.png\" alt=\"\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062a\u0635\u0648\u06cc\u0631\" loading=\"lazy\" width=\"800\" height=\"52\" title=\"\"><\/p>\n<p><strong>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0628\u0631\u0646\u0627\u0645\u0647<\/strong>:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n    &lt;title&gt;Python Code Documentation&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Python Code Documentation&lt;\/h1&gt;\n\n    &lt;h2&gt;Import Libraries&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Import libraries\nimport warnings\nimport itertools\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport statsmodels.api as sm&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Defaults and Configuration&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Defaults\nplt.rcParams['figure.figsize'] = (20.0, 10.0)\nplt.rcParams.update({'font.size': 12})\nplt.style.use('ggplot')&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Loading Data&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Load the data\ndata = pd.read_csv('international-airline-passengers.csv', engine=\"python\", skipfooter=3)&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Data Preprocessing&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# A bit of pre-processing to make it nicer\ndata['Month']=pd.to_datetime(data['Month'], format=\"%Y-%m-%d\")\ndata.set_index(['Month'], inplace=True)&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Plotting the Data&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Plot the data\ndata.plot()\nplt.ylabel('Monthly airline passengers (x1000)')\nplt.xlabel('Date')\nplt.show()&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Parameter Combinations&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Define the d and q parameters to take any value between 0 and 1\nq = d = range(0, 2)\n# Define the p parameters to take any value between 0 and 3\np = range(0, 4)\n# Generate all different combinations of p, q, and q triplets\npdq = list(itertools.product(p, d, q))\n# Generate all different combinations of seasonal p, q, and q triplets\nseasonal_pdq = [(x[0], x[1], x[2], 12) for x in list(itertools.product(p, d, q))]&lt;\/code&gt;&lt;\/pre&gt;\n\n    &lt;h2&gt;Fitting and Selecting Model&lt;\/h2&gt;\n    &lt;pre&gt;&lt;code&gt;# Fitting and selecting the best model based on AIC\ntrain_data = data['1949-01-01':'1959-12-01']\ntest_data = data['1960-01-01':'1960-12-01']\nwarnings.filterwarnings(\"ignore\") # specify to ignore warning messages\nAIC = []\nSARIMAX_model = []\nfor param in pdq:\n    for param_seasonal in seasonal_pdq:\n        try:\n            mod = sm.tsa.statespace.SARIMAX(train_data,\n                                            order=param,\n                                            seasonal_order=param_seasonal,\n                                            enforce_stationarity=False,\n                                            enforce_invertibility=False)\n\n            results = mod.fit()\n\n            print('SARIMAX{}x{} - AIC:{}'.format(param, param_seasonal, results.aic), end='\\r')\n            AIC.append(results.aic)\n            SARIMAX_model.append([param, param_seasonal])\n        except:\n            continue\n\nprint('The smallest AIC is {} for model SARIMAX{}x{}'.format(min(AIC), SARIMAX_model[AIC.index(min(AIC))][0],SARIMAX_model[AIC.index(min(AIC))][1]))\n\n# Fitting the best model\nmod = sm.tsa.statespace.SARIMAX(train_data,\n                                order=SARIMAX_model\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0645\u0648\u0631\u062f \u0622\u0632\u0645\u0627\u06cc\u0634\u06cc<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nabfollower.com\/blog\/wp-content\/uploads\/2023\/05\/1684742456_985_ChatGPT-Unplugged-\u062a\u0648\u0627\u0646\u0645\u0646\u062f\u0633\u0627\u0632\u06cc-\u062a\u0648\u0633\u0639\u0647-\u062f\u0647\u0646\u062f\u0647-\u0628\u0631\u0627\u06cc-\u0645\u0633\u062a\u0646\u062f\u0627\u062a.png\" alt=\"\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062a\u0635\u0648\u06cc\u0631\" loading=\"lazy\" width=\"800\" height=\"504\" title=\"\"><\/p>\n<p><strong>\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0647\u0627\u06cc \u062a\u0633\u062a \u0648\u0627\u062d\u062f<\/strong>:<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>import unittest\nimport pandas as pd\nimport numpy as np\nimport statsmodels.api as sm\n\nclass TestTimeSeriesAnalysis(unittest.TestCase):\n\n    def setUp(self):\n        # Set up test data\n        self.data = pd.DataFrame({'Month': ['1949-01-01', '1949-02-01', '1949-03-01'],\n                                  'Passengers': [112, 118, 132]})\n        self.data['Month'] = pd.to_datetime(self.data['Month'], format=\"%Y-%m-%d\")\n        self.data.set_index(['Month'], inplace=True)\n\n    def test_data_preprocessing(self):\n        # Test data preprocessing\n        processed_data = preprocess_data(self.data)\n        self.assertEqual(len(processed_data), len(self.data))\n        self.assertEqual(processed_data.index[0], self.data.index[0])\n        self.assertEqual(processed_data.index[-1], self.data.index[-1])\n\n    def test_model_fitting(self):\n        # Test model fitting\n        model = fit_model(self.data)\n        self.assertIsInstance(model, sm.tsa.statespace.SARIMAX)\n\n    def test_forecasting(self):\n        # Test forecasting\n        forecast = generate_forecast(self.data, steps=3)\n        self.assertEqual(len(forecast), 3)\n        self.assertEqual(forecast.index[-1], self.data.index[-1] + pd.DateOffset(months=2))\n\n    def test_evaluation(self):\n        # Test evaluation\n        forecast = generate_forecast(self.data, steps=3)\n        evaluation = evaluate_forecast(forecast, self.data)\n        self.assertIsInstance(evaluation, float)\n        self.assertTrue(evaluation &gt;= 0)\n\nif __name__ == '__main__':\n    unittest.main()\n\n<\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0686\u0627\u0628\u06a9 \u06a9\u0627\u0631 \u0628\u0627 \u0627\u0633\u0646\u0627\u062f \u0632\u0646\u062f\u0647 \u0631\u0627 \u0627\u0631\u0632\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f \u06a9\u0647 \u062f\u0631 \u062d\u06cc\u0646 \u0633\u0627\u0632\u06af\u0627\u0631\u06cc \u0628\u0627 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u060c \u0628\u0647 \u067e\u0631\u0648\u0698\u0647 \u0627\u0631\u0632\u0634 \u0645\u06cc\u200c\u0627\u0641\u0632\u0627\u06cc\u062f.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0645\u0642\u062f\u0645\u0647:\u0627\u06cc\u0646 \u0627\u0641\u0633\u0627\u0646\u0647 \u06a9\u0647 &#8220;\u0647\u06cc\u0686 \u0633\u0646\u062f\u06cc \u062f\u0631 Agile \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f&#8221; \u062f\u0642\u06cc\u0642 \u0646\u06cc\u0633\u062a. \u062f\u0631 \u062d\u0627\u0644\u06cc \u06a9\u0647 Agile \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u06a9\u0627\u0631 \u0631\u0627 \u062f\u0631 \u0627\u0648\u0644\u0648\u06cc\u062a \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u062f\u060c \u0627\u0631\u0632\u0634 \u0627\u0633\u0646\u0627\u062f \u0631\u0627 \u062a\u0634\u062e\u06cc\u0635 \u0645\u06cc \u062f\u0647\u062f. Agile \u0627\u0633\u0646\u0627\u062f \u0633\u0628\u06a9 \u0648\u0632\u0646 \u0648 \u0627\u0646\u0639\u0637\u0627\u0641 \u067e\u0630\u06cc\u0631\u06cc \u0631\u0627 \u062a\u0631\u0648\u06cc\u062c \u0645\u06cc \u06a9\u0646\u062f \u06a9\u0647 \u0627\u0632 \u0647\u0645\u06a9\u0627\u0631\u06cc \u0648 \u0627\u0631\u062a\u0628\u0627\u0637 \u062f\u0631 \u062a\u06cc\u0645 \u0648 \u0628\u0627 \u0633\u0647\u0627\u0645\u062f\u0627\u0631\u0627\u0646 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0645\u06cc \u06a9\u0646\u062f. \u0645\u0633\u062a\u0646\u062f\u0627\u062a &hellip;<\/p>\n","protected":false},"author":2,"featured_media":24258,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-24257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/24257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=24257"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/24257\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/24258"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=24257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=24257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=24257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}