noshot 0.3.8__py3-none-any.whl → 0.4.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.
- noshot/data/ML TS XAI/CIA-1-Delhi Boy.ipynb +535 -0
- noshot/data/ML TS XAI/Football Player/4.ipynb +395 -0
- noshot/data/ML TS XAI/ML Additional/Bank.ipynb +74 -0
- noshot/data/ML TS XAI/ML Additional/LR.ipynb +69 -0
- noshot/data/ML TS XAI/ML Additional/ObesityDataSet_raw_and_data_sinthetic.csv +2112 -0
- noshot/data/ML TS XAI/ML Additional/Q4 LR.csv +206 -0
- noshot/data/ML TS XAI/ML Additional/Q7 BANK DETAILS.csv +41189 -0
- noshot/data/ML TS XAI/ML Additional/airfoil.ipynb +69 -0
- noshot/data/ML TS XAI/ML Additional/obesity.ipynb +78 -0
- noshot/data/ML TS XAI/ML Additional/voronoicode.ipynb +81 -0
- noshot/data/ML TS XAI/ML Lab CIA - Healthy Class/1/airfoil_self_noise.dat +1503 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/AllinOne.ipynb +1 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/Heart-Disease-UCI-0.ipynb +886 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/Housing-0.ipynb +292 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/Lab Code Ex 1-4.ipynb +1 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/data/Housing.csv +546 -0
- noshot/data/ML TS XAI/ML Lab CIA - Our Class/data/heart_disease_uci.csv +921 -0
- {noshot-0.3.8.dist-info → noshot-0.4.0.dist-info}/METADATA +1 -1
- noshot-0.4.0.dist-info/RECORD +48 -0
- noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data.ipynb +0 -247
- noshot/data/ML TS XAI/TS/2. Feature Engineering.ipynb +0 -183
- noshot/data/ML TS XAI/TS/3. Temporal Relationships.ipynb +0 -172
- noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interpolation.ipynb +0 -146
- noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality.ipynb +0 -173
- noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation.ipynb +0 -77
- noshot/data/ML TS XAI/TS/AllinOne.ipynb +0 -1416
- noshot/data/ML TS XAI/TS/data/daily-min-temperatures.csv +0 -3651
- noshot/data/ML TS XAI/TS/data/daily-total-female-births.csv +0 -366
- noshot/data/ML TS XAI/TS/data/raw_sales.csv +0 -29581
- noshot/data/ML TS XAI/TS/data/shampoo_sales.csv +0 -37
- noshot/data/ML TS XAI/TS Lab CIA/1 - AirPassengers/1 - AirPassengers.ipynb +0 -198
- noshot/data/ML TS XAI/TS Lab CIA/1 - AirPassengers/AirPassengers.csv +0 -145
- noshot/data/ML TS XAI/TS Lab CIA/2 - Daily-total-female-births/2 - daily-total-female-births.ipynb +0 -209
- noshot/data/ML TS XAI/TS Lab CIA/2 - Daily-total-female-births/daily-total-female-births.csv +0 -366
- noshot/data/ML TS XAI/TS Lab CIA/3 - Bill Charge/3 - Bill Charge.ipynb +0 -169
- noshot/data/ML TS XAI/TS Lab CIA/3 - Bill Charge/bill charge.csv +0 -21
- noshot/data/ML TS XAI/TS Lab CIA/4 - Daily min temperatures/4 - daily-min-temperatures.ipynb +0 -181
- noshot/data/ML TS XAI/TS Lab CIA/4 - Daily min temperatures/daily-min-temperatures.csv +0 -3651
- noshot/data/ML TS XAI/TS Lab CIA/5 - shampoo sales/5 - Shampoo sales.ipynb +0 -213
- noshot/data/ML TS XAI/TS Lab CIA/5 - shampoo sales/shampoo_sales.csv +0 -37
- noshot/data/ML TS XAI/TS Lab CIA/Questions TMS 27 Feb 25.pdf +0 -0
- noshot-0.3.8.dist-info/RECORD +0 -53
- /noshot/data/ML TS XAI/{ML Lab CIA/1 → ML Additional}/airfoil_self_noise.dat +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/1/1.ipynb +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/1/Question.txt +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/2/2.ipynb +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/2/Question.txt +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/2/pop_failures.dat +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/3/3.ipynb +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/3/Qu.txt +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/3/go_track_tracks.csv +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/4/4.ipynb +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/4/Wilt.csv +0 -0
- /noshot/data/ML TS XAI/{ML Lab CIA → ML Lab CIA - Healthy Class}/4/qu.txt +0 -0
- {noshot-0.3.8.dist-info → noshot-0.4.0.dist-info}/LICENSE.txt +0 -0
- {noshot-0.3.8.dist-info → noshot-0.4.0.dist-info}/WHEEL +0 -0
- {noshot-0.3.8.dist-info → noshot-0.4.0.dist-info}/top_level.txt +0 -0
@@ -1,37 +0,0 @@
|
|
1
|
-
Month,Sales
|
2
|
-
01-01,266
|
3
|
-
01-02,145.9
|
4
|
-
01-03,183.1
|
5
|
-
01-04,119.3
|
6
|
-
01-05,180.3
|
7
|
-
01-06,168.5
|
8
|
-
01-07,231.8
|
9
|
-
01-08,224.5
|
10
|
-
01-09,192.8
|
11
|
-
1-10,122.9
|
12
|
-
1-11,336.5
|
13
|
-
1-12,185.9
|
14
|
-
02-01,194.3
|
15
|
-
02-02,149.5
|
16
|
-
02-03,210.1
|
17
|
-
02-04,273.3
|
18
|
-
02-05,191.4
|
19
|
-
02-06,287
|
20
|
-
02-07,226
|
21
|
-
02-08,303.6
|
22
|
-
02-09,289.9
|
23
|
-
2-10,421.6
|
24
|
-
2-11,264.5
|
25
|
-
2-12,342.3
|
26
|
-
03-01,339.7
|
27
|
-
03-02,440.4
|
28
|
-
03-03,315.9
|
29
|
-
03-04,439.3
|
30
|
-
03-05,401.3
|
31
|
-
03-06,437.4
|
32
|
-
03-07,575.5
|
33
|
-
03-08,407.6
|
34
|
-
03-09,682
|
35
|
-
3-10,475.3
|
36
|
-
3-11,581.3
|
37
|
-
3-12,646.9
|
@@ -1,198 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": null,
|
6
|
-
"id": "87ec015f-1801-4aae-a7ae-3c16428341ba",
|
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
|
-
"import seaborn as sns\n",
|
14
|
-
"from statsmodels.tsa.stattools import adfuller\n",
|
15
|
-
"from statsmodels.tsa.seasonal import seasonal_decompose"
|
16
|
-
]
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"cell_type": "code",
|
20
|
-
"execution_count": null,
|
21
|
-
"id": "44d66930-1a1c-4088-868f-2f433939e8fc",
|
22
|
-
"metadata": {},
|
23
|
-
"outputs": [],
|
24
|
-
"source": [
|
25
|
-
"df = pd.read_csv('AirPassengers.csv')\n",
|
26
|
-
"print(\"Dataset Loaded Successfully\")\n",
|
27
|
-
"df.head()"
|
28
|
-
]
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"cell_type": "code",
|
32
|
-
"execution_count": null,
|
33
|
-
"id": "cdc1ab64-0857-4bc6-b09a-58f8531a8f4b",
|
34
|
-
"metadata": {},
|
35
|
-
"outputs": [],
|
36
|
-
"source": [
|
37
|
-
"df['Month'] = pd.to_datetime(df['Month'])\n",
|
38
|
-
"df.set_index('Month', inplace=True)\n",
|
39
|
-
"df.info()"
|
40
|
-
]
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"cell_type": "code",
|
44
|
-
"execution_count": null,
|
45
|
-
"id": "38df2890-85ae-4bf4-a612-7d2a0b1ce1ac",
|
46
|
-
"metadata": {},
|
47
|
-
"outputs": [],
|
48
|
-
"source": [
|
49
|
-
"print(\"\\nDataset Summary:\")\n",
|
50
|
-
"df.describe()"
|
51
|
-
]
|
52
|
-
},
|
53
|
-
{
|
54
|
-
"cell_type": "code",
|
55
|
-
"execution_count": null,
|
56
|
-
"id": "a2347abf-db03-4b8a-be92-6dc2c617367e",
|
57
|
-
"metadata": {},
|
58
|
-
"outputs": [],
|
59
|
-
"source": [
|
60
|
-
"df['Year'] = df.index.year\n",
|
61
|
-
"df['Month_Num'] = df.index.month\n",
|
62
|
-
"yearly_data = df.groupby('Year')['#Passengers'].sum()\n",
|
63
|
-
"monthly_data = df.groupby('Month_Num')['#Passengers'].mean()\n",
|
64
|
-
"print(\"\\nYearly Data:\")\n",
|
65
|
-
"print(yearly_data.head())\n",
|
66
|
-
"print(\"\\nMonthly Data:\")\n",
|
67
|
-
"print(monthly_data.head())"
|
68
|
-
]
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"cell_type": "code",
|
72
|
-
"execution_count": null,
|
73
|
-
"id": "0bee4ef4-6272-410a-87a7-119f68ea98b1",
|
74
|
-
"metadata": {},
|
75
|
-
"outputs": [],
|
76
|
-
"source": [
|
77
|
-
"plt.figure(figsize=(12, 6))\n",
|
78
|
-
"df['#Passengers'].plot(title='Air Passengers Over Time')\n",
|
79
|
-
"plt.xlabel('Year')\n",
|
80
|
-
"plt.ylabel('Number of Passengers')\n",
|
81
|
-
"plt.show()"
|
82
|
-
]
|
83
|
-
},
|
84
|
-
{
|
85
|
-
"cell_type": "code",
|
86
|
-
"execution_count": null,
|
87
|
-
"id": "e7917c24-12a4-4932-a9e7-3d0d1bff8244",
|
88
|
-
"metadata": {},
|
89
|
-
"outputs": [],
|
90
|
-
"source": [
|
91
|
-
"plt.figure(figsize=(8, 5))\n",
|
92
|
-
"plt.hist(df['#Passengers'], bins=20, edgecolor='black')\n",
|
93
|
-
"plt.title(\"Histogram of Passenger Counts\")\n",
|
94
|
-
"plt.xlabel(\"Passengers\")\n",
|
95
|
-
"plt.ylabel(\"Frequency\")\n",
|
96
|
-
"plt.show()"
|
97
|
-
]
|
98
|
-
},
|
99
|
-
{
|
100
|
-
"cell_type": "code",
|
101
|
-
"execution_count": null,
|
102
|
-
"id": "1e34240f-9035-4653-bf4d-b7d4dcad71fc",
|
103
|
-
"metadata": {},
|
104
|
-
"outputs": [],
|
105
|
-
"source": [
|
106
|
-
"sns.kdeplot(df['#Passengers'], fill=True)\n",
|
107
|
-
"plt.title(\"Density Plot of Passenger Counts\")\n",
|
108
|
-
"plt.show()"
|
109
|
-
]
|
110
|
-
},
|
111
|
-
{
|
112
|
-
"cell_type": "code",
|
113
|
-
"execution_count": null,
|
114
|
-
"id": "d136e68a-4d9f-44dd-a604-32a4901cb579",
|
115
|
-
"metadata": {},
|
116
|
-
"outputs": [],
|
117
|
-
"source": [
|
118
|
-
"plt.figure(figsize=(8, 6))\n",
|
119
|
-
"sns.heatmap(df.corr(), annot=True, cmap='coolwarm')\n",
|
120
|
-
"plt.title(\"Correlation Heatmap\")\n",
|
121
|
-
"plt.show()"
|
122
|
-
]
|
123
|
-
},
|
124
|
-
{
|
125
|
-
"cell_type": "code",
|
126
|
-
"execution_count": null,
|
127
|
-
"id": "dcd61b6d-a5bd-4ac8-a8a9-ff67aacef211",
|
128
|
-
"metadata": {},
|
129
|
-
"outputs": [],
|
130
|
-
"source": [
|
131
|
-
"df['Rolling_Mean_3'] = df['#Passengers'].rolling(3).mean()\n",
|
132
|
-
"df['Expanding_Mean'] = df['#Passengers'].expanding().mean()\n",
|
133
|
-
"df.head()"
|
134
|
-
]
|
135
|
-
},
|
136
|
-
{
|
137
|
-
"cell_type": "code",
|
138
|
-
"execution_count": null,
|
139
|
-
"id": "8fc86da3-a4c2-4bd4-adc0-71b00483aaea",
|
140
|
-
"metadata": {},
|
141
|
-
"outputs": [],
|
142
|
-
"source": [
|
143
|
-
"#ADF test\n",
|
144
|
-
"print(\"\\nPerforming ADF Test for Stationarity:\")\n",
|
145
|
-
"adf_result = adfuller(df['#Passengers'])\n",
|
146
|
-
"print(f\"ADF Statistic: {adf_result[0]}\")\n",
|
147
|
-
"print(f\"p-value: {adf_result[1]}\")\n",
|
148
|
-
"print(f\"Critical Values: {adf_result[4]}\")"
|
149
|
-
]
|
150
|
-
},
|
151
|
-
{
|
152
|
-
"cell_type": "code",
|
153
|
-
"execution_count": null,
|
154
|
-
"id": "49a5b13c-b883-47c9-af10-792cf8cca8f4",
|
155
|
-
"metadata": {},
|
156
|
-
"outputs": [],
|
157
|
-
"source": [
|
158
|
-
"decomposed = seasonal_decompose(df['#Passengers'], model='additive', period=12)\n",
|
159
|
-
"plt.figure(figsize=(12, 8))\n",
|
160
|
-
"plt.subplot(411)\n",
|
161
|
-
"plt.plot(df['#Passengers'], label='Original')\n",
|
162
|
-
"plt.legend(loc='best')\n",
|
163
|
-
"plt.subplot(412)\n",
|
164
|
-
"plt.plot(decomposed.trend, label='Trend')\n",
|
165
|
-
"plt.legend(loc='best')\n",
|
166
|
-
"plt.subplot(413)\n",
|
167
|
-
"plt.plot(decomposed.seasonal, label='Seasonality')\n",
|
168
|
-
"plt.legend(loc='best')\n",
|
169
|
-
"plt.subplot(414)\n",
|
170
|
-
"plt.plot(decomposed.resid, label='Residuals')\n",
|
171
|
-
"plt.legend(loc='best')\n",
|
172
|
-
"plt.tight_layout()\n",
|
173
|
-
"plt.show()"
|
174
|
-
]
|
175
|
-
}
|
176
|
-
],
|
177
|
-
"metadata": {
|
178
|
-
"kernelspec": {
|
179
|
-
"display_name": "Python 3 (ipykernel)",
|
180
|
-
"language": "python",
|
181
|
-
"name": "python3"
|
182
|
-
},
|
183
|
-
"language_info": {
|
184
|
-
"codemirror_mode": {
|
185
|
-
"name": "ipython",
|
186
|
-
"version": 3
|
187
|
-
},
|
188
|
-
"file_extension": ".py",
|
189
|
-
"mimetype": "text/x-python",
|
190
|
-
"name": "python",
|
191
|
-
"nbconvert_exporter": "python",
|
192
|
-
"pygments_lexer": "ipython3",
|
193
|
-
"version": "3.12.4"
|
194
|
-
}
|
195
|
-
},
|
196
|
-
"nbformat": 4,
|
197
|
-
"nbformat_minor": 5
|
198
|
-
}
|
@@ -1,145 +0,0 @@
|
|
1
|
-
Month,#Passengers
|
2
|
-
1949-01,112
|
3
|
-
1949-02,118
|
4
|
-
1949-03,132
|
5
|
-
1949-04,129
|
6
|
-
1949-05,121
|
7
|
-
1949-06,135
|
8
|
-
1949-07,148
|
9
|
-
1949-08,148
|
10
|
-
1949-09,136
|
11
|
-
1949-10,119
|
12
|
-
1949-11,104
|
13
|
-
1949-12,118
|
14
|
-
1950-01,115
|
15
|
-
1950-02,126
|
16
|
-
1950-03,141
|
17
|
-
1950-04,135
|
18
|
-
1950-05,125
|
19
|
-
1950-06,149
|
20
|
-
1950-07,170
|
21
|
-
1950-08,170
|
22
|
-
1950-09,158
|
23
|
-
1950-10,133
|
24
|
-
1950-11,114
|
25
|
-
1950-12,140
|
26
|
-
1951-01,145
|
27
|
-
1951-02,150
|
28
|
-
1951-03,178
|
29
|
-
1951-04,163
|
30
|
-
1951-05,172
|
31
|
-
1951-06,178
|
32
|
-
1951-07,199
|
33
|
-
1951-08,199
|
34
|
-
1951-09,184
|
35
|
-
1951-10,162
|
36
|
-
1951-11,146
|
37
|
-
1951-12,166
|
38
|
-
1952-01,171
|
39
|
-
1952-02,180
|
40
|
-
1952-03,193
|
41
|
-
1952-04,181
|
42
|
-
1952-05,183
|
43
|
-
1952-06,218
|
44
|
-
1952-07,230
|
45
|
-
1952-08,242
|
46
|
-
1952-09,209
|
47
|
-
1952-10,191
|
48
|
-
1952-11,172
|
49
|
-
1952-12,194
|
50
|
-
1953-01,196
|
51
|
-
1953-02,196
|
52
|
-
1953-03,236
|
53
|
-
1953-04,235
|
54
|
-
1953-05,229
|
55
|
-
1953-06,243
|
56
|
-
1953-07,264
|
57
|
-
1953-08,272
|
58
|
-
1953-09,237
|
59
|
-
1953-10,211
|
60
|
-
1953-11,180
|
61
|
-
1953-12,201
|
62
|
-
1954-01,204
|
63
|
-
1954-02,188
|
64
|
-
1954-03,235
|
65
|
-
1954-04,227
|
66
|
-
1954-05,234
|
67
|
-
1954-06,264
|
68
|
-
1954-07,302
|
69
|
-
1954-08,293
|
70
|
-
1954-09,259
|
71
|
-
1954-10,229
|
72
|
-
1954-11,203
|
73
|
-
1954-12,229
|
74
|
-
1955-01,242
|
75
|
-
1955-02,233
|
76
|
-
1955-03,267
|
77
|
-
1955-04,269
|
78
|
-
1955-05,270
|
79
|
-
1955-06,315
|
80
|
-
1955-07,364
|
81
|
-
1955-08,347
|
82
|
-
1955-09,312
|
83
|
-
1955-10,274
|
84
|
-
1955-11,237
|
85
|
-
1955-12,278
|
86
|
-
1956-01,284
|
87
|
-
1956-02,277
|
88
|
-
1956-03,317
|
89
|
-
1956-04,313
|
90
|
-
1956-05,318
|
91
|
-
1956-06,374
|
92
|
-
1956-07,413
|
93
|
-
1956-08,405
|
94
|
-
1956-09,355
|
95
|
-
1956-10,306
|
96
|
-
1956-11,271
|
97
|
-
1956-12,306
|
98
|
-
1957-01,315
|
99
|
-
1957-02,301
|
100
|
-
1957-03,356
|
101
|
-
1957-04,348
|
102
|
-
1957-05,355
|
103
|
-
1957-06,422
|
104
|
-
1957-07,465
|
105
|
-
1957-08,467
|
106
|
-
1957-09,404
|
107
|
-
1957-10,347
|
108
|
-
1957-11,305
|
109
|
-
1957-12,336
|
110
|
-
1958-01,340
|
111
|
-
1958-02,318
|
112
|
-
1958-03,362
|
113
|
-
1958-04,348
|
114
|
-
1958-05,363
|
115
|
-
1958-06,435
|
116
|
-
1958-07,491
|
117
|
-
1958-08,505
|
118
|
-
1958-09,404
|
119
|
-
1958-10,359
|
120
|
-
1958-11,310
|
121
|
-
1958-12,337
|
122
|
-
1959-01,360
|
123
|
-
1959-02,342
|
124
|
-
1959-03,406
|
125
|
-
1959-04,396
|
126
|
-
1959-05,420
|
127
|
-
1959-06,472
|
128
|
-
1959-07,548
|
129
|
-
1959-08,559
|
130
|
-
1959-09,463
|
131
|
-
1959-10,407
|
132
|
-
1959-11,362
|
133
|
-
1959-12,405
|
134
|
-
1960-01,417
|
135
|
-
1960-02,391
|
136
|
-
1960-03,419
|
137
|
-
1960-04,461
|
138
|
-
1960-05,472
|
139
|
-
1960-06,535
|
140
|
-
1960-07,622
|
141
|
-
1960-08,606
|
142
|
-
1960-09,508
|
143
|
-
1960-10,461
|
144
|
-
1960-11,390
|
145
|
-
1960-12,432
|
noshot/data/ML TS XAI/TS Lab CIA/2 - Daily-total-female-births/2 - daily-total-female-births.ipynb
DELETED
@@ -1,209 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": null,
|
6
|
-
"id": "487cf97a-4bd0-433b-8c0b-db8eb551354a",
|
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
|
-
"import seaborn as sns\n",
|
14
|
-
"from statsmodels.tsa.stattools import adfuller\n",
|
15
|
-
"from statsmodels.tsa.seasonal import seasonal_decompose"
|
16
|
-
]
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"cell_type": "code",
|
20
|
-
"execution_count": null,
|
21
|
-
"id": "dd6a9dc6-1e40-4fd1-8be4-6c69b50d82d8",
|
22
|
-
"metadata": {},
|
23
|
-
"outputs": [],
|
24
|
-
"source": [
|
25
|
-
"df = pd.read_csv('daily-total-female-births.csv')\n",
|
26
|
-
"print(\"Dataset Loaded Successfully\")\n",
|
27
|
-
"df.head()"
|
28
|
-
]
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"cell_type": "code",
|
32
|
-
"execution_count": null,
|
33
|
-
"id": "1aee6411-6105-4d85-ac03-b7b8ec2d190d",
|
34
|
-
"metadata": {},
|
35
|
-
"outputs": [],
|
36
|
-
"source": [
|
37
|
-
"df['Date'] = pd.to_datetime(df['Date'])\n",
|
38
|
-
"df.set_index('Date', inplace=True)\n",
|
39
|
-
"df.info()"
|
40
|
-
]
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"cell_type": "code",
|
44
|
-
"execution_count": null,
|
45
|
-
"id": "64c2371b-1ac2-47e6-89be-9d6456c55c90",
|
46
|
-
"metadata": {},
|
47
|
-
"outputs": [],
|
48
|
-
"source": [
|
49
|
-
"print(\"\\nDataset Summary:\")\n",
|
50
|
-
"df.describe()"
|
51
|
-
]
|
52
|
-
},
|
53
|
-
{
|
54
|
-
"cell_type": "code",
|
55
|
-
"execution_count": null,
|
56
|
-
"id": "81010eaa-b416-47b3-b727-e86da7f8161b",
|
57
|
-
"metadata": {},
|
58
|
-
"outputs": [],
|
59
|
-
"source": [
|
60
|
-
"df['Year'] = df.index.year\n",
|
61
|
-
"df['Month_Num'] = df.index.month\n",
|
62
|
-
"yearly_data = df.groupby('Year')['Births'].sum()\n",
|
63
|
-
"monthly_data = df.groupby('Month_Num')['Births'].mean()\n",
|
64
|
-
"print(\"\\nYearly Data:\")\n",
|
65
|
-
"display(yearly_data.head())\n",
|
66
|
-
"print(\"\\nMonthly Data:\")\n",
|
67
|
-
"display(monthly_data.head())"
|
68
|
-
]
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"cell_type": "code",
|
72
|
-
"execution_count": null,
|
73
|
-
"id": "ca8b19ba-18e3-45c9-8ba9-ba2a1e386cfe",
|
74
|
-
"metadata": {},
|
75
|
-
"outputs": [],
|
76
|
-
"source": [
|
77
|
-
"plt.figure(figsize=(12, 6))\n",
|
78
|
-
"df['Births'].plot(title='Daily Total Female Births Over Time')\n",
|
79
|
-
"plt.xlabel('Year')\n",
|
80
|
-
"plt.ylabel('Number of Births')\n",
|
81
|
-
"plt.show()"
|
82
|
-
]
|
83
|
-
},
|
84
|
-
{
|
85
|
-
"cell_type": "code",
|
86
|
-
"execution_count": null,
|
87
|
-
"id": "21e2a172-9b10-4ac1-acc5-e08fcccb9c83",
|
88
|
-
"metadata": {},
|
89
|
-
"outputs": [],
|
90
|
-
"source": [
|
91
|
-
"plt.figure(figsize=(8, 5))\n",
|
92
|
-
"plt.hist(df['Births'], bins=20, edgecolor='black')\n",
|
93
|
-
"plt.title(\"Histogram of Birth Counts\")\n",
|
94
|
-
"plt.xlabel(\"Births\")\n",
|
95
|
-
"plt.ylabel(\"Frequency\")\n",
|
96
|
-
"plt.show()"
|
97
|
-
]
|
98
|
-
},
|
99
|
-
{
|
100
|
-
"cell_type": "code",
|
101
|
-
"execution_count": null,
|
102
|
-
"id": "425a688c-5125-463d-9061-273ce4558db4",
|
103
|
-
"metadata": {},
|
104
|
-
"outputs": [],
|
105
|
-
"source": [
|
106
|
-
"sns.kdeplot(df['Births'], fill=True)\n",
|
107
|
-
"plt.title(\"Density Plot of Birth Counts\")\n",
|
108
|
-
"plt.show()"
|
109
|
-
]
|
110
|
-
},
|
111
|
-
{
|
112
|
-
"cell_type": "code",
|
113
|
-
"execution_count": null,
|
114
|
-
"id": "91058ea5-efb8-4d74-b1a5-3820deca3417",
|
115
|
-
"metadata": {},
|
116
|
-
"outputs": [],
|
117
|
-
"source": [
|
118
|
-
"sns.boxplot(df['Births'])\n",
|
119
|
-
"plt.title(\"Box and Whisker Plot of Birth Counts\")\n",
|
120
|
-
"plt.show()"
|
121
|
-
]
|
122
|
-
},
|
123
|
-
{
|
124
|
-
"cell_type": "code",
|
125
|
-
"execution_count": null,
|
126
|
-
"id": "ae19d7a0-af99-4c07-9250-13098bf9f436",
|
127
|
-
"metadata": {},
|
128
|
-
"outputs": [],
|
129
|
-
"source": [
|
130
|
-
"df['Rolling_Mean_3'] = df['Births'].rolling(3).mean()\n",
|
131
|
-
"df['Expanding_Mean'] = df['Births'].expanding().mean()\n",
|
132
|
-
"df.head()"
|
133
|
-
]
|
134
|
-
},
|
135
|
-
{
|
136
|
-
"cell_type": "code",
|
137
|
-
"execution_count": null,
|
138
|
-
"id": "9dd9ff6c-4b3b-46d1-85cf-daf6af100b48",
|
139
|
-
"metadata": {},
|
140
|
-
"outputs": [],
|
141
|
-
"source": [
|
142
|
-
"df_resampled = df.resample('W').mean() # Weekly resampling\n",
|
143
|
-
"interpolated_df = df.interpolate(method='linear') # Linear interpolation\n",
|
144
|
-
"interpolated_df.head()"
|
145
|
-
]
|
146
|
-
},
|
147
|
-
{
|
148
|
-
"cell_type": "code",
|
149
|
-
"execution_count": null,
|
150
|
-
"id": "bfa32ab5-48ee-4aff-8217-881e8429ebe8",
|
151
|
-
"metadata": {},
|
152
|
-
"outputs": [],
|
153
|
-
"source": [
|
154
|
-
"#(ADF Test)\n",
|
155
|
-
"print(\"\\nPerforming ADF Test for Stationarity:\")\n",
|
156
|
-
"adf_result = adfuller(df['Births'])\n",
|
157
|
-
"print(f\"ADF Statistic: {adf_result[0]}\")\n",
|
158
|
-
"print(f\"p-value: {adf_result[1]}\")\n",
|
159
|
-
"print(f\"Critical Values: {adf_result[4]}\")"
|
160
|
-
]
|
161
|
-
},
|
162
|
-
{
|
163
|
-
"cell_type": "code",
|
164
|
-
"execution_count": null,
|
165
|
-
"id": "4aecf4be-05a1-4bae-8b6b-c5f5e5f49480",
|
166
|
-
"metadata": {},
|
167
|
-
"outputs": [],
|
168
|
-
"source": [
|
169
|
-
"decomposed = seasonal_decompose(df['Births'], model='additive', period=7)\n",
|
170
|
-
"plt.figure(figsize=(12, 8))\n",
|
171
|
-
"plt.subplot(411)\n",
|
172
|
-
"plt.plot(df['Births'], label='Original')\n",
|
173
|
-
"plt.legend(loc='best')\n",
|
174
|
-
"plt.subplot(412)\n",
|
175
|
-
"plt.plot(decomposed.trend, label='Trend')\n",
|
176
|
-
"plt.legend(loc='best')\n",
|
177
|
-
"plt.subplot(413)\n",
|
178
|
-
"plt.plot(decomposed.seasonal, label='Seasonality')\n",
|
179
|
-
"plt.legend(loc='best')\n",
|
180
|
-
"plt.subplot(414)\n",
|
181
|
-
"plt.plot(decomposed.resid, label='Residuals')\n",
|
182
|
-
"plt.legend(loc='best')\n",
|
183
|
-
"plt.tight_layout()\n",
|
184
|
-
"plt.show()"
|
185
|
-
]
|
186
|
-
}
|
187
|
-
],
|
188
|
-
"metadata": {
|
189
|
-
"kernelspec": {
|
190
|
-
"display_name": "Python 3 (ipykernel)",
|
191
|
-
"language": "python",
|
192
|
-
"name": "python3"
|
193
|
-
},
|
194
|
-
"language_info": {
|
195
|
-
"codemirror_mode": {
|
196
|
-
"name": "ipython",
|
197
|
-
"version": 3
|
198
|
-
},
|
199
|
-
"file_extension": ".py",
|
200
|
-
"mimetype": "text/x-python",
|
201
|
-
"name": "python",
|
202
|
-
"nbconvert_exporter": "python",
|
203
|
-
"pygments_lexer": "ipython3",
|
204
|
-
"version": "3.12.4"
|
205
|
-
}
|
206
|
-
},
|
207
|
-
"nbformat": 4,
|
208
|
-
"nbformat_minor": 5
|
209
|
-
}
|