noshot 0.4.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb +246 -0
  2. noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb +228 -0
  3. noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb +77 -0
  4. noshot/data/ML TS XAI/TS/7. Differencing.ipynb +167 -0
  5. noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb +197 -0
  6. noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb +220 -0
  7. noshot/main.py +18 -18
  8. noshot/utils/__init__.py +2 -2
  9. noshot/utils/shell_utils.py +56 -56
  10. {noshot-0.4.0.dist-info → noshot-0.9.0.dist-info}/METADATA +58 -55
  11. noshot-0.9.0.dist-info/RECORD +15 -0
  12. {noshot-0.4.0.dist-info → noshot-0.9.0.dist-info}/WHEEL +1 -1
  13. {noshot-0.4.0.dist-info → noshot-0.9.0.dist-info/licenses}/LICENSE.txt +20 -20
  14. noshot/data/ML TS XAI/CIA-1-Delhi Boy.ipynb +0 -535
  15. noshot/data/ML TS XAI/Football Player/4.ipynb +0 -395
  16. noshot/data/ML TS XAI/ML/1. PCA - EDA.ipynb +0 -207
  17. noshot/data/ML TS XAI/ML/2. KNN Classifier.ipynb +0 -287
  18. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis.ipynb +0 -83
  19. noshot/data/ML TS XAI/ML/4. Linear Regression.ipynb +0 -117
  20. noshot/data/ML TS XAI/ML/5. Logistic Regression.ipynb +0 -151
  21. noshot/data/ML TS XAI/ML/6. Bayesian Classifier.ipynb +0 -89
  22. noshot/data/ML TS XAI/ML/data/balance-scale.csv +0 -626
  23. noshot/data/ML TS XAI/ML/data/balance-scale.txt +0 -625
  24. noshot/data/ML TS XAI/ML/data/machine-data.csv +0 -210
  25. noshot/data/ML TS XAI/ML/data/wine-dataset.csv +0 -179
  26. noshot/data/ML TS XAI/ML Additional/Bank.ipynb +0 -74
  27. noshot/data/ML TS XAI/ML Additional/LR.ipynb +0 -69
  28. noshot/data/ML TS XAI/ML Additional/ObesityDataSet_raw_and_data_sinthetic.csv +0 -2112
  29. noshot/data/ML TS XAI/ML Additional/Q4 LR.csv +0 -206
  30. noshot/data/ML TS XAI/ML Additional/Q7 BANK DETAILS.csv +0 -41189
  31. noshot/data/ML TS XAI/ML Additional/airfoil.ipynb +0 -69
  32. noshot/data/ML TS XAI/ML Additional/airfoil_self_noise.dat +0 -1503
  33. noshot/data/ML TS XAI/ML Additional/obesity.ipynb +0 -78
  34. noshot/data/ML TS XAI/ML Additional/voronoicode.ipynb +0 -81
  35. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/1/1.ipynb +0 -133
  36. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/1/Question.txt +0 -12
  37. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/1/airfoil_self_noise.dat +0 -1503
  38. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/2/2.ipynb +0 -139
  39. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/2/Question.txt +0 -12
  40. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/2/pop_failures.dat +0 -143
  41. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/3/3.ipynb +0 -130
  42. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/3/Qu.txt +0 -1
  43. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/3/go_track_tracks.csv +0 -164
  44. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/4/4.ipynb +0 -141
  45. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/4/Wilt.csv +0 -4340
  46. noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/4/qu.txt +0 -1
  47. noshot/data/ML TS XAI/ML Lab CIA - Our Class/AllinOne.ipynb +0 -1
  48. noshot/data/ML TS XAI/ML Lab CIA - Our Class/Heart-Disease-UCI-0.ipynb +0 -886
  49. noshot/data/ML TS XAI/ML Lab CIA - Our Class/Housing-0.ipynb +0 -292
  50. noshot/data/ML TS XAI/ML Lab CIA - Our Class/Lab Code Ex 1-4.ipynb +0 -1
  51. noshot/data/ML TS XAI/ML Lab CIA - Our Class/data/Housing.csv +0 -546
  52. noshot/data/ML TS XAI/ML Lab CIA - Our Class/data/heart_disease_uci.csv +0 -921
  53. noshot-0.4.0.dist-info/RECORD +0 -48
  54. {noshot-0.4.0.dist-info → noshot-0.9.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,246 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "142adfce-1c93-475a-a465-0f344cbc6b93",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import numpy as np\n",
11
+ "import pandas as pd\n",
12
+ "import matplotlib.pyplot as plt\n",
13
+ "from sklearn.metrics import mean_squared_error\n",
14
+ "from pandas.plotting import autocorrelation_plot\n",
15
+ "from statsmodels.graphics.tsaplots import plot_acf, plot_pacf\n",
16
+ "import statsmodels.api as sm\n",
17
+ "from statsmodels.tsa.arima_model import ARIMA\n",
18
+ "import warnings\n",
19
+ "warnings.filterwarnings('ignore')"
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "code",
24
+ "execution_count": null,
25
+ "id": "b10b8b58-6c78-442e-b712-67b16f228f15",
26
+ "metadata": {},
27
+ "outputs": [],
28
+ "source": [
29
+ "df = pd.read_csv('monthly-sunspots.csv', parse_dates=[0])\n",
30
+ "df.head(10)"
31
+ ]
32
+ },
33
+ {
34
+ "cell_type": "code",
35
+ "execution_count": null,
36
+ "id": "3b123997-e868-4998-bbb6-9031ea8ab39f",
37
+ "metadata": {},
38
+ "outputs": [],
39
+ "source": [
40
+ "plt.figure(figsize=(10,8))\n",
41
+ "plt.plot(df['Month'], df['Sunspots'], color = 'green', label = 'Sunspot Numbers')\n",
42
+ "plt.xlabel('Date')\n",
43
+ "plt.ylabel('Sunspot Numbers')\n",
44
+ "plt.grid()\n",
45
+ "plt.title('Monthly Mean Sunspot Numbers')\n",
46
+ "plt.show()"
47
+ ]
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "execution_count": null,
52
+ "id": "9c56e5d1-a019-457b-8313-c5f71b378a5a",
53
+ "metadata": {},
54
+ "outputs": [],
55
+ "source": [
56
+ "df.describe().T"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": null,
62
+ "id": "94752ac3-fb85-41c1-94dc-f1a05b0baf75",
63
+ "metadata": {},
64
+ "outputs": [],
65
+ "source": [
66
+ "df['Month'] = pd.to_datetime(df['Month'])\n",
67
+ "data_new = df.set_index(df['Month'])\n",
68
+ "data_new = data_new.drop(labels = ['Month'], axis = 1)\n",
69
+ "data_new.head()"
70
+ ]
71
+ },
72
+ {
73
+ "cell_type": "code",
74
+ "execution_count": null,
75
+ "id": "b02c91b4-f7ee-4ce5-b707-6bf2604bed55",
76
+ "metadata": {},
77
+ "outputs": [],
78
+ "source": [
79
+ "fig = plt.figure(figsize=(10,8))\n",
80
+ "data_new['Sunspots'].plot(style = 'k.')"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "execution_count": null,
86
+ "id": "dca190cd-41b8-44d5-8ed2-190c87b04fb9",
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "data_q = data_new.resample('q').mean()\n",
91
+ "data_q.head()"
92
+ ]
93
+ },
94
+ {
95
+ "cell_type": "code",
96
+ "execution_count": null,
97
+ "id": "1f944805-6b99-4854-a7c2-53bf2a6de1c2",
98
+ "metadata": {},
99
+ "outputs": [],
100
+ "source": [
101
+ "def adfuller_test(data):\n",
102
+ " result = adfuller(data)\n",
103
+ " labels = ['ADF Test Statistic' 'P-value', 'Lags Used', 'Number of Observation Used']\n",
104
+ " for value, label in zip(result, labels):\n",
105
+ " print(label+\": \"+str(value))\n",
106
+ " if result[1] <= 0.05:\n",
107
+ " print(\"Strong evidencew against the null hypothesis(h0), reject the null hypothesis. Data has no unit root and is stationary\")\n",
108
+ " else:\n",
109
+ " print(\"Weak evidence against null hypothesis, time series has a unit root, indicating it is non-stationary\")"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "code",
114
+ "execution_count": null,
115
+ "id": "1e2740f4-ba2b-4fc4-a310-131b15ae20cb",
116
+ "metadata": {},
117
+ "outputs": [],
118
+ "source": [
119
+ "data_q.plot(figsize=(10,8))"
120
+ ]
121
+ },
122
+ {
123
+ "cell_type": "code",
124
+ "execution_count": null,
125
+ "id": "8062e59f-4149-45fc-b2ca-3f586c6ed078",
126
+ "metadata": {},
127
+ "outputs": [],
128
+ "source": [
129
+ "base_data = data_q.copy()\n",
130
+ "base_data['Monthly Mean Total Sunspot Number'] = base_data['Sunspots']\n",
131
+ "base_data['Shifter Monthly Mean Total Sunspot Number'] = base_data['Monthly Mean Total Sunspot Number'].shift(1)"
132
+ ]
133
+ },
134
+ {
135
+ "cell_type": "code",
136
+ "execution_count": null,
137
+ "id": "8232f405-2560-4b9a-870e-8af209ef0f87",
138
+ "metadata": {},
139
+ "outputs": [],
140
+ "source": [
141
+ "base_data.head()"
142
+ ]
143
+ },
144
+ {
145
+ "cell_type": "code",
146
+ "execution_count": null,
147
+ "id": "9cb81777-9f8d-4c64-ad4f-7c245454085e",
148
+ "metadata": {},
149
+ "outputs": [],
150
+ "source": [
151
+ "base_data[['Monthly Mean Total Sunspot Number', 'Shifter Monthly Mean Total Sunspot Number']].plot()"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": null,
157
+ "id": "1e27fde3-cef9-4366-a972-52a974226d91",
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "base_data = base_data.dropna()\n",
162
+ "print(\"Mean Squared Error:\", mean_squared_error(base_data['Monthly Mean Total Sunspot Number'], \n",
163
+ " base_data['Shifter Monthly Mean Total Sunspot Number']))"
164
+ ]
165
+ },
166
+ {
167
+ "cell_type": "code",
168
+ "execution_count": null,
169
+ "id": "cd01e7eb-5e88-41e8-9ddd-1ea35f054b4b",
170
+ "metadata": {},
171
+ "outputs": [],
172
+ "source": [
173
+ "fig = plt.figure(figsize=(10,8))\n",
174
+ "autocorrelation_plot(data_q)\n",
175
+ "plt.show()"
176
+ ]
177
+ },
178
+ {
179
+ "cell_type": "code",
180
+ "execution_count": null,
181
+ "id": "2d127256-a9cc-431d-95ae-6f8323aa21b7",
182
+ "metadata": {},
183
+ "outputs": [],
184
+ "source": [
185
+ "fig = plt.figure(figsize=(10,8))\n",
186
+ "ax1 = fig.add_subplot(211)\n",
187
+ "fig = sm.graphics.tsa.plot_acf(data_q, lags = 40, ax = ax1)\n",
188
+ "ax2 = fig.add_subplot(212)\n",
189
+ "fig = sm.graphics.tsa.plot_pacf(data_q, lags = 40, ax = ax2)"
190
+ ]
191
+ },
192
+ {
193
+ "cell_type": "code",
194
+ "execution_count": null,
195
+ "id": "03258c9e-a3b6-465b-98ca-d5cc6a481626",
196
+ "metadata": {},
197
+ "outputs": [],
198
+ "source": [
199
+ "model = sm.tsa.statespace.SARIMAX(data_q['Sunspots'], order=(2,0,2), seasonal_order=(2,0,2,6))\n",
200
+ "results = model.fit()"
201
+ ]
202
+ },
203
+ {
204
+ "cell_type": "code",
205
+ "execution_count": null,
206
+ "id": "4eb643eb-59ae-475c-9096-87e536da8e62",
207
+ "metadata": {},
208
+ "outputs": [],
209
+ "source": [
210
+ "results.summary()"
211
+ ]
212
+ },
213
+ {
214
+ "cell_type": "code",
215
+ "execution_count": null,
216
+ "id": "c2350c09-4c80-4c24-88d8-3b645981ce21",
217
+ "metadata": {},
218
+ "outputs": [],
219
+ "source": [
220
+ "data_q['forecast'] = results.predict(start = 1000, end = 1084, dynamic = True)\n",
221
+ "data_q[['Sunspots', 'forecast']].plot(figsize = (10,8))"
222
+ ]
223
+ }
224
+ ],
225
+ "metadata": {
226
+ "kernelspec": {
227
+ "display_name": "Python 3 (ipykernel)",
228
+ "language": "python",
229
+ "name": "python3"
230
+ },
231
+ "language_info": {
232
+ "codemirror_mode": {
233
+ "name": "ipython",
234
+ "version": 3
235
+ },
236
+ "file_extension": ".py",
237
+ "mimetype": "text/x-python",
238
+ "name": "python",
239
+ "nbconvert_exporter": "python",
240
+ "pygments_lexer": "ipython3",
241
+ "version": "3.12.4"
242
+ }
243
+ },
244
+ "nbformat": 4,
245
+ "nbformat_minor": 5
246
+ }
@@ -0,0 +1,228 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "8f9faf6e",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import numpy as np\n",
11
+ "import pandas as pd\n",
12
+ "import matplotlib.pyplot as plt\n",
13
+ "from statsmodels.tsa.stattools import adfuller\n",
14
+ "from statsmodels.tsa.stattools import grangercausalitytests\n",
15
+ "from statsmodels.tsa.statespace.varmax import VARMAX\n",
16
+ "from statsmodels.tsa.api import VAR\n",
17
+ "import warnings\n",
18
+ "warnings.filterwarnings('ignore')"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "id": "da824655",
25
+ "metadata": {},
26
+ "outputs": [],
27
+ "source": [
28
+ "custom_column_names = ['WSR0','WSR1']\n",
29
+ "df = pd.read_csv('eighthr.csv', parse_dates=[0], na_values=['?'],\n",
30
+ " index_col=0, names = (['WSR0', 'WSR1']+list(range(3, 74))))\n",
31
+ "df = df.dropna()\n",
32
+ "df.head()"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type": "code",
37
+ "execution_count": null,
38
+ "id": "92bf562d",
39
+ "metadata": {},
40
+ "outputs": [],
41
+ "source": [
42
+ "df['WSR0'] = df['WSR0'].astype(float)\n",
43
+ "df['WSR1'] = df['WSR1'].astype(float)"
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "execution_count": null,
49
+ "id": "f578482e",
50
+ "metadata": {},
51
+ "outputs": [],
52
+ "source": [
53
+ "fig,axes = plt.subplots(2,1,figsize=(14,8))\n",
54
+ "df['WSR1'].plot(ax=axes[0],title='WSR0')\n",
55
+ "df['WSR0'].plot(ax=axes[1],title='WSR1')\n",
56
+ "plt.show()"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": null,
62
+ "id": "daac380f",
63
+ "metadata": {},
64
+ "outputs": [],
65
+ "source": [
66
+ "result = adfuller(df['WSR0'])\n",
67
+ "print(result)\n",
68
+ "if result[1]<0.05:\n",
69
+ " print(\"It is Stationary\")\n",
70
+ "else:\n",
71
+ " print(\"It is not stationary\")"
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "code",
76
+ "execution_count": null,
77
+ "id": "e18f51f2",
78
+ "metadata": {},
79
+ "outputs": [],
80
+ "source": [
81
+ "result = adfuller(df['WSR1'])\n",
82
+ "print(result)\n",
83
+ "if result[1]<0.05:\n",
84
+ " print(\"It is Stationary\")\n",
85
+ "else:\n",
86
+ " print(\"It is not stationary\")"
87
+ ]
88
+ },
89
+ {
90
+ "cell_type": "code",
91
+ "execution_count": null,
92
+ "id": "0b6419c1",
93
+ "metadata": {},
94
+ "outputs": [],
95
+ "source": [
96
+ "print('WSR0 causes WSR1')\n",
97
+ "print('---------------------')\n",
98
+ "granger1=grangercausalitytests(df[['WSR0','WSR1']],2)\n",
99
+ "print('WSR1 causes WSR0')\n",
100
+ "print('---------------------')\n",
101
+ "granger1=grangercausalitytests(df[['WSR1','WSR0']],2)"
102
+ ]
103
+ },
104
+ {
105
+ "cell_type": "code",
106
+ "execution_count": null,
107
+ "id": "b37f4f93",
108
+ "metadata": {},
109
+ "outputs": [],
110
+ "source": [
111
+ "train = df[['WSR0','WSR1']]\n",
112
+ "model = VAR(train)\n",
113
+ "sortedmodel = model.select_order(maxlags=20)\n",
114
+ "sortedmodel.summary()"
115
+ ]
116
+ },
117
+ {
118
+ "cell_type": "code",
119
+ "execution_count": null,
120
+ "id": "3da00920",
121
+ "metadata": {},
122
+ "outputs": [],
123
+ "source": [
124
+ "model = VARMAX(df[['WSR0', 'WSR1']], order=(10,0),enforce_stationarity=True)\n",
125
+ "model_fit = model.fit()\n",
126
+ "model_fit.summary()"
127
+ ]
128
+ },
129
+ {
130
+ "cell_type": "code",
131
+ "execution_count": null,
132
+ "id": "0b0cf16d",
133
+ "metadata": {},
134
+ "outputs": [],
135
+ "source": [
136
+ "n_forecast = 12\n",
137
+ "pred = model_fit.get_prediction()\n",
138
+ "preds = pred.predicted_mean"
139
+ ]
140
+ },
141
+ {
142
+ "cell_type": "code",
143
+ "execution_count": null,
144
+ "id": "56954749",
145
+ "metadata": {},
146
+ "outputs": [],
147
+ "source": [
148
+ "preds.columns = ['WSR0 Predictions','WSR1 Predictions']\n",
149
+ "preds"
150
+ ]
151
+ },
152
+ {
153
+ "cell_type": "code",
154
+ "execution_count": null,
155
+ "id": "704c6372",
156
+ "metadata": {},
157
+ "outputs": [],
158
+ "source": [
159
+ "train = df[['WSR0','WSR1']]\n",
160
+ "testvspread = pd.concat([train,preds],axis=1)\n",
161
+ "testvspread"
162
+ ]
163
+ },
164
+ {
165
+ "cell_type": "code",
166
+ "execution_count": null,
167
+ "id": "d60e3508",
168
+ "metadata": {},
169
+ "outputs": [],
170
+ "source": [
171
+ "testvspread[['WSR0','WSR0 Predictions']].plot()"
172
+ ]
173
+ },
174
+ {
175
+ "cell_type": "code",
176
+ "execution_count": null,
177
+ "id": "28fb2660",
178
+ "metadata": {},
179
+ "outputs": [],
180
+ "source": [
181
+ "testvspread[['WSR1','WSR1 Predictions']].plot()"
182
+ ]
183
+ },
184
+ {
185
+ "cell_type": "code",
186
+ "execution_count": null,
187
+ "id": "35888acd",
188
+ "metadata": {},
189
+ "outputs": [],
190
+ "source": [
191
+ "from sklearn.metrics import mean_squared_error\n",
192
+ "mean_squared_error(testvspread['WSR1'],testvspread['WSR1 Predictions'])"
193
+ ]
194
+ },
195
+ {
196
+ "cell_type": "code",
197
+ "execution_count": null,
198
+ "id": "41748e7e",
199
+ "metadata": {},
200
+ "outputs": [],
201
+ "source": [
202
+ "from sklearn.metrics import mean_squared_error\n",
203
+ "mean_squared_error(testvspread['WSR0'],testvspread['WSR0 Predictions'])"
204
+ ]
205
+ }
206
+ ],
207
+ "metadata": {
208
+ "kernelspec": {
209
+ "display_name": "Python 3 (ipykernel)",
210
+ "language": "python",
211
+ "name": "python3"
212
+ },
213
+ "language_info": {
214
+ "codemirror_mode": {
215
+ "name": "ipython",
216
+ "version": 3
217
+ },
218
+ "file_extension": ".py",
219
+ "mimetype": "text/x-python",
220
+ "name": "python",
221
+ "nbconvert_exporter": "python",
222
+ "pygments_lexer": "ipython3",
223
+ "version": "3.12.4"
224
+ }
225
+ },
226
+ "nbformat": 4,
227
+ "nbformat_minor": 5
228
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "97b25ae4-1eb7-4599-bad4-e959bbb9a275",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd\n",
11
+ "import numpy as np\n",
12
+ "import matplotlib.pyplot as plt\n",
13
+ "from statsmodels.graphics.tsaplots import plot_acf, plot_pacf"
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "code",
18
+ "execution_count": null,
19
+ "id": "f70584ab-aa4d-4957-9315-3e884f66c559",
20
+ "metadata": {},
21
+ "outputs": [],
22
+ "source": [
23
+ "df = pd.read_csv('daily-min-temperatures.csv')\n",
24
+ "print(df.shape)\n",
25
+ "df.head()"
26
+ ]
27
+ },
28
+ {
29
+ "cell_type": "code",
30
+ "execution_count": null,
31
+ "id": "b6574dd0-e010-423b-bb26-ba2ca142e848",
32
+ "metadata": {},
33
+ "outputs": [],
34
+ "source": [
35
+ "df.plot(title = \"daily Minimum Temperature\" ,figsize = (14, 8), legend = None, color = 'green')\n",
36
+ "plt.xlabel('Date')\n",
37
+ "plt.ylabel('Temperature (°C)')\n",
38
+ "plt.show()"
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "code",
43
+ "execution_count": null,
44
+ "id": "3ba0f2ea-069c-4aa2-aa4b-0d90a54ee21f",
45
+ "metadata": {},
46
+ "outputs": [],
47
+ "source": [
48
+ "fig, axs = plt.subplots(2, 1, figsize = (10,8))\n",
49
+ "plot_acf(df['Temp'], lags = 30, ax = axs[0], title = 'Autocorrelation (ACF)', color = 'green')\n",
50
+ "plot_pacf(df['Temp'], lags = 30, ax = axs[1], title = 'Partial Autocorrelation (PACF)', color = 'red')\n",
51
+ "plt.tight_layout()\n",
52
+ "plt.show()"
53
+ ]
54
+ }
55
+ ],
56
+ "metadata": {
57
+ "kernelspec": {
58
+ "display_name": "Python 3 (ipykernel)",
59
+ "language": "python",
60
+ "name": "python3"
61
+ },
62
+ "language_info": {
63
+ "codemirror_mode": {
64
+ "name": "ipython",
65
+ "version": 3
66
+ },
67
+ "file_extension": ".py",
68
+ "mimetype": "text/x-python",
69
+ "name": "python",
70
+ "nbconvert_exporter": "python",
71
+ "pygments_lexer": "ipython3",
72
+ "version": "3.12.4"
73
+ }
74
+ },
75
+ "nbformat": 4,
76
+ "nbformat_minor": 5
77
+ }