noshot 0.4.1__tar.gz → 1.0.0__tar.gz

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 (44) hide show
  1. {noshot-0.4.1 → noshot-1.0.0}/PKG-INFO +1 -1
  2. {noshot-0.4.1 → noshot-1.0.0}/noshot.egg-info/PKG-INFO +1 -1
  3. noshot-1.0.0/noshot.egg-info/SOURCES.txt +35 -0
  4. {noshot-0.4.1 → noshot-1.0.0}/setup.py +1 -1
  5. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb +246 -0
  6. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb +228 -0
  7. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb +77 -0
  8. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/7. Differencing.ipynb +167 -0
  9. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb +197 -0
  10. noshot-1.0.0/src/noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb +220 -0
  11. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/EDA2_chipsdatset.ipynb +633 -0
  12. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/EDA_IRISH_8thjan.ipynb +326 -0
  13. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/XAI_EX1 MODEL BIAS (FINAL).ipynb +487 -0
  14. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/complete_guide_to_eda_on_text_data.ipynb +845 -0
  15. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/deepchecksframeworks.ipynb +100 -0
  16. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/deepexplainers (mnist).ipynb +90 -0
  17. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/guidedbackpropagation.ipynb +203 -0
  18. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/updated_image_EDA1_with_LRP.ipynb +3998 -0
  19. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 1/zebrastripes.ipynb +271 -0
  20. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/EXP_5.ipynb +1545 -0
  21. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-3 (EDA-loan).ipynb +221 -0
  22. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-3 (EDA-movie).ipynb +229 -0
  23. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-4(Flower dataset).ipynb +237 -0
  24. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-4.ipynb +241 -0
  25. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp_2.ipynb +352 -0
  26. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/Exp_7.ipynb +110 -0
  27. noshot-1.0.0/src/noshot/data/ML TS XAI/XAI/XAI 2/FeatureImportance_SensitivityAnalysis.ipynb +708 -0
  28. noshot-0.4.1/noshot.egg-info/SOURCES.txt +0 -18
  29. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb +0 -928
  30. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb +0 -1270
  31. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb +0 -175
  32. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/7. Differencing.ipynb +0 -303
  33. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb +0 -746
  34. noshot-0.4.1/src/noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb +0 -579
  35. {noshot-0.4.1 → noshot-1.0.0}/LICENSE.txt +0 -0
  36. {noshot-0.4.1 → noshot-1.0.0}/README.md +0 -0
  37. {noshot-0.4.1 → noshot-1.0.0}/noshot.egg-info/dependency_links.txt +0 -0
  38. {noshot-0.4.1 → noshot-1.0.0}/noshot.egg-info/not-zip-safe +0 -0
  39. {noshot-0.4.1 → noshot-1.0.0}/noshot.egg-info/top_level.txt +0 -0
  40. {noshot-0.4.1 → noshot-1.0.0}/setup.cfg +0 -0
  41. {noshot-0.4.1 → noshot-1.0.0}/src/noshot/__init__.py +0 -0
  42. {noshot-0.4.1 → noshot-1.0.0}/src/noshot/main.py +0 -0
  43. {noshot-0.4.1 → noshot-1.0.0}/src/noshot/utils/__init__.py +0 -0
  44. {noshot-0.4.1 → noshot-1.0.0}/src/noshot/utils/shell_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: noshot
3
- Version: 0.4.1
3
+ Version: 1.0.0
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: noshot
3
- Version: 0.4.1
3
+ Version: 1.0.0
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -0,0 +1,35 @@
1
+ LICENSE.txt
2
+ README.md
3
+ setup.py
4
+ noshot.egg-info/PKG-INFO
5
+ noshot.egg-info/SOURCES.txt
6
+ noshot.egg-info/dependency_links.txt
7
+ noshot.egg-info/not-zip-safe
8
+ noshot.egg-info/top_level.txt
9
+ src/noshot/__init__.py
10
+ src/noshot/main.py
11
+ src/noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb
12
+ src/noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb
13
+ src/noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb
14
+ src/noshot/data/ML TS XAI/TS/7. Differencing.ipynb
15
+ src/noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb
16
+ src/noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb
17
+ src/noshot/data/ML TS XAI/XAI/XAI 1/EDA2_chipsdatset.ipynb
18
+ src/noshot/data/ML TS XAI/XAI/XAI 1/EDA_IRISH_8thjan.ipynb
19
+ src/noshot/data/ML TS XAI/XAI/XAI 1/XAI_EX1 MODEL BIAS (FINAL).ipynb
20
+ src/noshot/data/ML TS XAI/XAI/XAI 1/complete_guide_to_eda_on_text_data.ipynb
21
+ src/noshot/data/ML TS XAI/XAI/XAI 1/deepchecksframeworks.ipynb
22
+ src/noshot/data/ML TS XAI/XAI/XAI 1/deepexplainers (mnist).ipynb
23
+ src/noshot/data/ML TS XAI/XAI/XAI 1/guidedbackpropagation.ipynb
24
+ src/noshot/data/ML TS XAI/XAI/XAI 1/updated_image_EDA1_with_LRP.ipynb
25
+ src/noshot/data/ML TS XAI/XAI/XAI 1/zebrastripes.ipynb
26
+ src/noshot/data/ML TS XAI/XAI/XAI 2/EXP_5.ipynb
27
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-3 (EDA-loan).ipynb
28
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-3 (EDA-movie).ipynb
29
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-4(Flower dataset).ipynb
30
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp-4.ipynb
31
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp_2.ipynb
32
+ src/noshot/data/ML TS XAI/XAI/XAI 2/Exp_7.ipynb
33
+ src/noshot/data/ML TS XAI/XAI/XAI 2/FeatureImportance_SensitivityAnalysis.ipynb
34
+ src/noshot/utils/__init__.py
35
+ src/noshot/utils/shell_utils.py
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="noshot",
8
- version="0.4.1",
8
+ version="1.0.0",
9
9
  author="Tim Stan S",
10
10
  description="Support library for Artificial Intelligence, Machine Learning and Data Science tools",
11
11
  long_description=long_description,
@@ -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
+ }