noshot 0.3.9__py3-none-any.whl → 0.4.1__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/TS/10. Seasonal ARIMA Forecasting.ipynb +928 -0
- noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb +1270 -0
- noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb +175 -0
- noshot/data/ML TS XAI/TS/7. Differencing.ipynb +303 -0
- noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb +746 -0
- noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb +579 -0
- noshot/main.py +18 -18
- noshot/utils/__init__.py +2 -2
- noshot/utils/shell_utils.py +56 -56
- {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/METADATA +58 -55
- noshot-0.4.1.dist-info/RECORD +15 -0
- {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/WHEEL +1 -1
- {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info/licenses}/LICENSE.txt +20 -20
- noshot/data/ML TS XAI/ML/1. PCA - EDA.ipynb +0 -207
- noshot/data/ML TS XAI/ML/2. KNN Classifier.ipynb +0 -287
- noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis.ipynb +0 -83
- noshot/data/ML TS XAI/ML/4. Linear Regression.ipynb +0 -117
- noshot/data/ML TS XAI/ML/5. Logistic Regression.ipynb +0 -151
- noshot/data/ML TS XAI/ML/6. Bayesian Classifier.ipynb +0 -89
- noshot/data/ML TS XAI/ML/data/balance-scale.csv +0 -626
- noshot/data/ML TS XAI/ML/data/balance-scale.txt +0 -625
- noshot/data/ML TS XAI/ML/data/machine-data.csv +0 -210
- noshot/data/ML TS XAI/ML/data/wine-dataset.csv +0 -179
- noshot/data/ML TS XAI/ML Additional/Bank.ipynb +0 -74
- noshot/data/ML TS XAI/ML Additional/LR.ipynb +0 -69
- noshot/data/ML TS XAI/ML Additional/ObesityDataSet_raw_and_data_sinthetic.csv +0 -2112
- noshot/data/ML TS XAI/ML Additional/Q4 LR.csv +0 -206
- noshot/data/ML TS XAI/ML Additional/Q7 BANK DETAILS.csv +0 -41189
- noshot/data/ML TS XAI/ML Additional/airfoil.ipynb +0 -69
- noshot/data/ML TS XAI/ML Additional/airfoil_self_noise.dat +0 -1503
- noshot/data/ML TS XAI/ML Additional/obesity.ipynb +0 -78
- noshot/data/ML TS XAI/ML Additional/voronoicode.ipynb +0 -81
- noshot/data/ML TS XAI/ML Lab CIA/1/1.ipynb +0 -133
- noshot/data/ML TS XAI/ML Lab CIA/1/Question.txt +0 -12
- noshot/data/ML TS XAI/ML Lab CIA/1/airfoil_self_noise.dat +0 -1503
- noshot/data/ML TS XAI/ML Lab CIA/2/2.ipynb +0 -139
- noshot/data/ML TS XAI/ML Lab CIA/2/Question.txt +0 -12
- noshot/data/ML TS XAI/ML Lab CIA/2/pop_failures.dat +0 -143
- noshot/data/ML TS XAI/ML Lab CIA/3/3.ipynb +0 -130
- noshot/data/ML TS XAI/ML Lab CIA/3/Qu.txt +0 -1
- noshot/data/ML TS XAI/ML Lab CIA/3/go_track_tracks.csv +0 -164
- noshot/data/ML TS XAI/ML Lab CIA/4/4.ipynb +0 -141
- noshot/data/ML TS XAI/ML Lab CIA/4/Wilt.csv +0 -4340
- noshot/data/ML TS XAI/ML Lab CIA/4/qu.txt +0 -1
- 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.9.dist-info/RECORD +0 -62
- {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
Perform classification USING KNN with and without PCA
|
@@ -1,247 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "markdown",
|
5
|
-
"id": "6b192e2a-14e9-4707-b1c1-e8f5aa32a919",
|
6
|
-
"metadata": {},
|
7
|
-
"source": [
|
8
|
-
"### __Import Required Libraries__"
|
9
|
-
]
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"cell_type": "code",
|
13
|
-
"execution_count": null,
|
14
|
-
"id": "95be04fa-500c-4308-9784-b07bb42d5232",
|
15
|
-
"metadata": {},
|
16
|
-
"outputs": [],
|
17
|
-
"source": [
|
18
|
-
"import pandas as pd\n",
|
19
|
-
"import matplotlib.pyplot as plt"
|
20
|
-
]
|
21
|
-
},
|
22
|
-
{
|
23
|
-
"cell_type": "markdown",
|
24
|
-
"id": "e5ff8a35-769d-4eda-b5f3-d3c9ba7a2dce",
|
25
|
-
"metadata": {},
|
26
|
-
"source": [
|
27
|
-
"##### __1. Importing the dataset__"
|
28
|
-
]
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"cell_type": "code",
|
32
|
-
"execution_count": null,
|
33
|
-
"id": "69caa184-219d-4b01-8a30-1ea9ba61dcff",
|
34
|
-
"metadata": {},
|
35
|
-
"outputs": [],
|
36
|
-
"source": [
|
37
|
-
"df = pd.read_csv('data/raw_sales.csv', index_col = 'datesold')\n",
|
38
|
-
"print(df.shape)"
|
39
|
-
]
|
40
|
-
},
|
41
|
-
{
|
42
|
-
"cell_type": "markdown",
|
43
|
-
"id": "f8273eed-a0e9-4d52-a183-350a7393a290",
|
44
|
-
"metadata": {},
|
45
|
-
"source": [
|
46
|
-
"##### __2. Display the first few rows to peek at the data, the last few rows__"
|
47
|
-
]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"cell_type": "code",
|
51
|
-
"execution_count": null,
|
52
|
-
"id": "490892d7-df7d-4c0f-9f8a-63883ce7432f",
|
53
|
-
"metadata": {},
|
54
|
-
"outputs": [],
|
55
|
-
"source": [
|
56
|
-
"df.head()"
|
57
|
-
]
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"cell_type": "code",
|
61
|
-
"execution_count": null,
|
62
|
-
"id": "24ae00c8-949b-4047-80ed-4f0631992c3f",
|
63
|
-
"metadata": {},
|
64
|
-
"outputs": [],
|
65
|
-
"source": [
|
66
|
-
"df.tail()"
|
67
|
-
]
|
68
|
-
},
|
69
|
-
{
|
70
|
-
"cell_type": "markdown",
|
71
|
-
"id": "9c24bbd0-75f0-4eb6-863d-7960337bcb77",
|
72
|
-
"metadata": {},
|
73
|
-
"source": [
|
74
|
-
"##### __3. Print the summary statistics__"
|
75
|
-
]
|
76
|
-
},
|
77
|
-
{
|
78
|
-
"cell_type": "code",
|
79
|
-
"execution_count": null,
|
80
|
-
"id": "bf0037dd-41b5-4c55-ae5c-8dfa5cb11f90",
|
81
|
-
"metadata": {},
|
82
|
-
"outputs": [],
|
83
|
-
"source": [
|
84
|
-
"df.describe().T"
|
85
|
-
]
|
86
|
-
},
|
87
|
-
{
|
88
|
-
"cell_type": "markdown",
|
89
|
-
"id": "fb7299b8-90fe-4dae-93a1-496129bc928a",
|
90
|
-
"metadata": {},
|
91
|
-
"source": [
|
92
|
-
"##### __4. Filter data for a specific year__"
|
93
|
-
]
|
94
|
-
},
|
95
|
-
{
|
96
|
-
"cell_type": "code",
|
97
|
-
"execution_count": null,
|
98
|
-
"id": "6a533c7b-6786-4789-9a18-0f19125de32d",
|
99
|
-
"metadata": {},
|
100
|
-
"outputs": [],
|
101
|
-
"source": [
|
102
|
-
"df.index = pd.to_datetime(df.index)\n",
|
103
|
-
"df['price'][df.index.year == 2007].mean()"
|
104
|
-
]
|
105
|
-
},
|
106
|
-
{
|
107
|
-
"cell_type": "markdown",
|
108
|
-
"id": "111029b6-fcc9-4f5e-a9d8-833ae27c039e",
|
109
|
-
"metadata": {},
|
110
|
-
"source": [
|
111
|
-
"##### __5. Plot the average price per year__"
|
112
|
-
]
|
113
|
-
},
|
114
|
-
{
|
115
|
-
"cell_type": "code",
|
116
|
-
"execution_count": null,
|
117
|
-
"id": "71212203-c3e5-49ca-aa07-bbc12a2e0de6",
|
118
|
-
"metadata": {},
|
119
|
-
"outputs": [],
|
120
|
-
"source": [
|
121
|
-
"group = df['price'].groupby(df.index.year).mean()\n",
|
122
|
-
"plt.plot(group.index, group.values, color = 'r', label = 'Average_Price/Yr')\n",
|
123
|
-
"plt.title('Average Price Year Wise')\n",
|
124
|
-
"plt.legend()\n",
|
125
|
-
"plt.show()"
|
126
|
-
]
|
127
|
-
},
|
128
|
-
{
|
129
|
-
"cell_type": "markdown",
|
130
|
-
"id": "0405f26e-b564-48a2-9fb5-6d89311a363e",
|
131
|
-
"metadata": {},
|
132
|
-
"source": [
|
133
|
-
"##### __6. Count of properties sold per year__"
|
134
|
-
]
|
135
|
-
},
|
136
|
-
{
|
137
|
-
"cell_type": "code",
|
138
|
-
"execution_count": null,
|
139
|
-
"id": "7e1cb0fb-f494-49b1-adbc-89824b7e3855",
|
140
|
-
"metadata": {},
|
141
|
-
"outputs": [],
|
142
|
-
"source": [
|
143
|
-
"group = df.groupby(df.index.year).count()\n",
|
144
|
-
"plt.bar(group.index, group.values[:, 0], color = 'g', label = 'Property_Sold/Yr')\n",
|
145
|
-
"plt.title('Property\\'s Sold Year Wise')\n",
|
146
|
-
"plt.legend()\n",
|
147
|
-
"plt.show()"
|
148
|
-
]
|
149
|
-
},
|
150
|
-
{
|
151
|
-
"cell_type": "markdown",
|
152
|
-
"id": "d9b4c518-05ec-41ba-956d-e145efc958fd",
|
153
|
-
"metadata": {},
|
154
|
-
"source": [
|
155
|
-
"##### __7. Query for a specific date range (e.g., Jan 2010 to Dec 2015)__"
|
156
|
-
]
|
157
|
-
},
|
158
|
-
{
|
159
|
-
"cell_type": "code",
|
160
|
-
"execution_count": null,
|
161
|
-
"id": "17f1f390-9e5b-4bc1-882a-88d0331e3a12",
|
162
|
-
"metadata": {},
|
163
|
-
"outputs": [],
|
164
|
-
"source": [
|
165
|
-
"df2 = df[(df.index > '1/1/2010') & (df.index <= '31/12/2015')]\n",
|
166
|
-
"df2"
|
167
|
-
]
|
168
|
-
},
|
169
|
-
{
|
170
|
-
"cell_type": "markdown",
|
171
|
-
"id": "28c84984-a5f0-4c46-963f-5c6e3336aed9",
|
172
|
-
"metadata": {},
|
173
|
-
"source": [
|
174
|
-
"##### __8. Calculate the mean price month-wise (use Groupby)__"
|
175
|
-
]
|
176
|
-
},
|
177
|
-
{
|
178
|
-
"cell_type": "code",
|
179
|
-
"execution_count": null,
|
180
|
-
"id": "db344276-03ab-4fb5-bb62-5dbc0fc11852",
|
181
|
-
"metadata": {},
|
182
|
-
"outputs": [],
|
183
|
-
"source": [
|
184
|
-
"df2['price'].groupby(df2.index.month).mean()"
|
185
|
-
]
|
186
|
-
},
|
187
|
-
{
|
188
|
-
"cell_type": "markdown",
|
189
|
-
"id": "3f1afa45-d234-4f01-bf63-ea2a5a73f708",
|
190
|
-
"metadata": {},
|
191
|
-
"source": [
|
192
|
-
"##### __9. Perform a histogram plot__"
|
193
|
-
]
|
194
|
-
},
|
195
|
-
{
|
196
|
-
"cell_type": "code",
|
197
|
-
"execution_count": null,
|
198
|
-
"id": "f0d19cd6-8800-4b7b-b827-6c8fb43d72d9",
|
199
|
-
"metadata": {},
|
200
|
-
"outputs": [],
|
201
|
-
"source": [
|
202
|
-
"plt.plot(df['price'])\n",
|
203
|
-
"plt.title('Price Distribution Time-Series')\n",
|
204
|
-
"plt.show()"
|
205
|
-
]
|
206
|
-
},
|
207
|
-
{
|
208
|
-
"cell_type": "markdown",
|
209
|
-
"id": "b33230fa-a886-4639-926a-cb60f0398745",
|
210
|
-
"metadata": {},
|
211
|
-
"source": [
|
212
|
-
"##### __10. Print the property price > 5Lakhs__"
|
213
|
-
]
|
214
|
-
},
|
215
|
-
{
|
216
|
-
"cell_type": "code",
|
217
|
-
"execution_count": null,
|
218
|
-
"id": "42695276-9e68-4e56-90a6-02a10e78ed14",
|
219
|
-
"metadata": {},
|
220
|
-
"outputs": [],
|
221
|
-
"source": [
|
222
|
-
"df[df['price'] > 500000]"
|
223
|
-
]
|
224
|
-
}
|
225
|
-
],
|
226
|
-
"metadata": {
|
227
|
-
"kernelspec": {
|
228
|
-
"display_name": "Python 3 (ipykernel)",
|
229
|
-
"language": "python",
|
230
|
-
"name": "python3"
|
231
|
-
},
|
232
|
-
"language_info": {
|
233
|
-
"codemirror_mode": {
|
234
|
-
"name": "ipython",
|
235
|
-
"version": 3
|
236
|
-
},
|
237
|
-
"file_extension": ".py",
|
238
|
-
"mimetype": "text/x-python",
|
239
|
-
"name": "python",
|
240
|
-
"nbconvert_exporter": "python",
|
241
|
-
"pygments_lexer": "ipython3",
|
242
|
-
"version": "3.12.4"
|
243
|
-
}
|
244
|
-
},
|
245
|
-
"nbformat": 4,
|
246
|
-
"nbformat_minor": 5
|
247
|
-
}
|
@@ -1,183 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": null,
|
6
|
-
"id": "ac978750-0ac5-4371-a0fb-a54f8503fc64",
|
7
|
-
"metadata": {},
|
8
|
-
"outputs": [],
|
9
|
-
"source": [
|
10
|
-
"import numpy as np\n",
|
11
|
-
"import pandas as pd\n",
|
12
|
-
"import matplotlib.pyplot as plt"
|
13
|
-
]
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"cell_type": "code",
|
17
|
-
"execution_count": null,
|
18
|
-
"id": "1bc21b2b-ccd4-4ed9-888b-b022bd800d26",
|
19
|
-
"metadata": {},
|
20
|
-
"outputs": [],
|
21
|
-
"source": [
|
22
|
-
"np.random.seed(42)\n",
|
23
|
-
"values = np.random.randn(100)\n",
|
24
|
-
"values[:10]"
|
25
|
-
]
|
26
|
-
},
|
27
|
-
{
|
28
|
-
"cell_type": "code",
|
29
|
-
"execution_count": null,
|
30
|
-
"id": "b23f68f1-98f8-4d36-8fc8-d92eb82240ae",
|
31
|
-
"metadata": {},
|
32
|
-
"outputs": [],
|
33
|
-
"source": [
|
34
|
-
"dates = pd.date_range(start='2023-01-01',end='2023-04-10',freq='D')\n",
|
35
|
-
"dates[:10]"
|
36
|
-
]
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"cell_type": "code",
|
40
|
-
"execution_count": null,
|
41
|
-
"id": "7c763c06-37fc-4070-b8ee-2241563a6ea4",
|
42
|
-
"metadata": {},
|
43
|
-
"outputs": [],
|
44
|
-
"source": [
|
45
|
-
"df = pd.DataFrame(values,index=dates,columns=['value'])\n",
|
46
|
-
"df.head()"
|
47
|
-
]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"cell_type": "code",
|
51
|
-
"execution_count": null,
|
52
|
-
"id": "3a3555e2-1925-4a94-85a2-5ca3909a4c72",
|
53
|
-
"metadata": {},
|
54
|
-
"outputs": [],
|
55
|
-
"source": [
|
56
|
-
"df['value'].plot(kind='hist',bins=20,title='value')\n",
|
57
|
-
"plt.show()"
|
58
|
-
]
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"cell_type": "code",
|
62
|
-
"execution_count": null,
|
63
|
-
"id": "d6188560-d5ed-4093-b3b0-7da64bfa99b1",
|
64
|
-
"metadata": {},
|
65
|
-
"outputs": [],
|
66
|
-
"source": [
|
67
|
-
"df['value'].plot(kind='hist',bins=20,title='value')\n",
|
68
|
-
"plt.show()"
|
69
|
-
]
|
70
|
-
},
|
71
|
-
{
|
72
|
-
"cell_type": "code",
|
73
|
-
"execution_count": null,
|
74
|
-
"id": "42b76b42-0f4e-4f90-904e-ef286fa92464",
|
75
|
-
"metadata": {},
|
76
|
-
"outputs": [],
|
77
|
-
"source": [
|
78
|
-
"df['value'].plot(kind='line',figsize=(8,4),title='value')\n",
|
79
|
-
"plt.show()"
|
80
|
-
]
|
81
|
-
},
|
82
|
-
{
|
83
|
-
"cell_type": "code",
|
84
|
-
"execution_count": null,
|
85
|
-
"id": "e1975c05-f04e-445f-8ddb-30ea29f3e231",
|
86
|
-
"metadata": {},
|
87
|
-
"outputs": [],
|
88
|
-
"source": [
|
89
|
-
"plt.figure(figsize=(10,6))\n",
|
90
|
-
"plt.plot(df['value'])\n",
|
91
|
-
"plt.xlabel('Date')\n",
|
92
|
-
"plt.ylabel('value')\n",
|
93
|
-
"plt.title('Synthetic time series Dataset')\n",
|
94
|
-
"plt.show()"
|
95
|
-
]
|
96
|
-
},
|
97
|
-
{
|
98
|
-
"cell_type": "code",
|
99
|
-
"execution_count": null,
|
100
|
-
"id": "6c46e388-cba3-43ca-b5ef-b5dfd55d4418",
|
101
|
-
"metadata": {},
|
102
|
-
"outputs": [],
|
103
|
-
"source": [
|
104
|
-
"df['year'] = df.index.year\n",
|
105
|
-
"df['month'] = df.index.month\n",
|
106
|
-
"df['day'] = df.index.day\n",
|
107
|
-
"df['weekday'] = df.index.weekday\n",
|
108
|
-
"df.head()"
|
109
|
-
]
|
110
|
-
},
|
111
|
-
{
|
112
|
-
"cell_type": "code",
|
113
|
-
"execution_count": null,
|
114
|
-
"id": "a09ab128-c1a1-40da-aa23-23862def187f",
|
115
|
-
"metadata": {},
|
116
|
-
"outputs": [],
|
117
|
-
"source": [
|
118
|
-
"df['lag_1']=df['value'].shift(1)\n",
|
119
|
-
"df.head()"
|
120
|
-
]
|
121
|
-
},
|
122
|
-
{
|
123
|
-
"cell_type": "code",
|
124
|
-
"execution_count": null,
|
125
|
-
"id": "30c06285-7362-48e2-80cb-89302f8a29e0",
|
126
|
-
"metadata": {},
|
127
|
-
"outputs": [],
|
128
|
-
"source": [
|
129
|
-
"df['lag_2']=df['value'].shift(2)\n",
|
130
|
-
"df.head()"
|
131
|
-
]
|
132
|
-
},
|
133
|
-
{
|
134
|
-
"cell_type": "code",
|
135
|
-
"execution_count": null,
|
136
|
-
"id": "9734d51b-898b-4c6b-a1cd-a30a5cdab71b",
|
137
|
-
"metadata": {},
|
138
|
-
"outputs": [],
|
139
|
-
"source": [
|
140
|
-
"df['rollling_mean_5'] = df['value'].rolling(5).mean()\n",
|
141
|
-
"df['rollling_std_5'] = df['value'].rolling(5).std()\n",
|
142
|
-
"df['rollling_min_5'] = df['value'].rolling(5).min()\n",
|
143
|
-
"df['rollling_max_5'] = df['value'].rolling(5).max()\n",
|
144
|
-
"df.head()"
|
145
|
-
]
|
146
|
-
},
|
147
|
-
{
|
148
|
-
"cell_type": "code",
|
149
|
-
"execution_count": null,
|
150
|
-
"id": "44564c15-d51e-4dd8-bed9-0d5d3e340fac",
|
151
|
-
"metadata": {},
|
152
|
-
"outputs": [],
|
153
|
-
"source": [
|
154
|
-
"df['expanding_mean_5'] = df['value'].expanding(5).mean()\n",
|
155
|
-
"df['expanding_std_5'] = df['value'].expanding(5).std()\n",
|
156
|
-
"df['expanding_min_5'] = df['value'].expanding(5).min()\n",
|
157
|
-
"df['expanding_max_5'] = df['value'].expanding(5).max()\n",
|
158
|
-
"df.head()"
|
159
|
-
]
|
160
|
-
}
|
161
|
-
],
|
162
|
-
"metadata": {
|
163
|
-
"kernelspec": {
|
164
|
-
"display_name": "Python 3 (ipykernel)",
|
165
|
-
"language": "python",
|
166
|
-
"name": "python3"
|
167
|
-
},
|
168
|
-
"language_info": {
|
169
|
-
"codemirror_mode": {
|
170
|
-
"name": "ipython",
|
171
|
-
"version": 3
|
172
|
-
},
|
173
|
-
"file_extension": ".py",
|
174
|
-
"mimetype": "text/x-python",
|
175
|
-
"name": "python",
|
176
|
-
"nbconvert_exporter": "python",
|
177
|
-
"pygments_lexer": "ipython3",
|
178
|
-
"version": "3.12.4"
|
179
|
-
}
|
180
|
-
},
|
181
|
-
"nbformat": 4,
|
182
|
-
"nbformat_minor": 5
|
183
|
-
}
|
@@ -1,172 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": null,
|
6
|
-
"id": "8fba5290-f2d4-4a0e-8ee6-54eea00d0684",
|
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
|
-
"import seaborn as sns"
|
14
|
-
]
|
15
|
-
},
|
16
|
-
{
|
17
|
-
"cell_type": "code",
|
18
|
-
"execution_count": null,
|
19
|
-
"id": "2d6192e1-b823-40b9-bb03-0fcc1bc0ab07",
|
20
|
-
"metadata": {},
|
21
|
-
"outputs": [],
|
22
|
-
"source": [
|
23
|
-
"np.random.seed(42)\n",
|
24
|
-
"dates = pd.date_range(start='2024-01-01',end='2024-04-09',freq='D')\n",
|
25
|
-
"values = np.random.normal(loc=78,scale=16,size=len(dates)) #loc-Mean of Distribution, scale-Standard Deviation"
|
26
|
-
]
|
27
|
-
},
|
28
|
-
{
|
29
|
-
"cell_type": "code",
|
30
|
-
"execution_count": null,
|
31
|
-
"id": "db65f62d-4477-4f0f-bc49-852a55f4003a",
|
32
|
-
"metadata": {},
|
33
|
-
"outputs": [],
|
34
|
-
"source": [
|
35
|
-
"df = pd.DataFrame(index=dates,data=values,columns=['Temperature'])\n",
|
36
|
-
"df.head()"
|
37
|
-
]
|
38
|
-
},
|
39
|
-
{
|
40
|
-
"cell_type": "code",
|
41
|
-
"execution_count": null,
|
42
|
-
"id": "a0a6c6ab-e310-465c-93d4-4c0cd4f4be7c",
|
43
|
-
"metadata": {},
|
44
|
-
"outputs": [],
|
45
|
-
"source": [
|
46
|
-
"df.isnull().sum()"
|
47
|
-
]
|
48
|
-
},
|
49
|
-
{
|
50
|
-
"cell_type": "code",
|
51
|
-
"execution_count": null,
|
52
|
-
"id": "ddb04850-cfc2-4b3a-b52c-e6adca900e9d",
|
53
|
-
"metadata": {},
|
54
|
-
"outputs": [],
|
55
|
-
"source": [
|
56
|
-
"df.describe().T"
|
57
|
-
]
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"cell_type": "code",
|
61
|
-
"execution_count": null,
|
62
|
-
"id": "c25aee71-9dcd-478a-b3df-2423395b948c",
|
63
|
-
"metadata": {},
|
64
|
-
"outputs": [],
|
65
|
-
"source": [
|
66
|
-
"df.plot(kind='hist',bins=20,figsize=(8,4))\n",
|
67
|
-
"plt.show()"
|
68
|
-
]
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"cell_type": "code",
|
72
|
-
"execution_count": null,
|
73
|
-
"id": "5b14dc33-237b-4e11-886b-4294ded57d6c",
|
74
|
-
"metadata": {},
|
75
|
-
"outputs": [],
|
76
|
-
"source": [
|
77
|
-
"df.plot(kind='kde',figsize=(8,4))\n",
|
78
|
-
"plt.show()"
|
79
|
-
]
|
80
|
-
},
|
81
|
-
{
|
82
|
-
"cell_type": "code",
|
83
|
-
"execution_count": null,
|
84
|
-
"id": "50b9c442-24ba-4afd-a41d-4449957ab056",
|
85
|
-
"metadata": {},
|
86
|
-
"outputs": [],
|
87
|
-
"source": [
|
88
|
-
"df.plot(kind='box',figsize=(4,4))\n",
|
89
|
-
"plt.show()"
|
90
|
-
]
|
91
|
-
},
|
92
|
-
{
|
93
|
-
"cell_type": "code",
|
94
|
-
"execution_count": null,
|
95
|
-
"id": "8b9f0eaa-7d81-4e43-a12f-22da8992390a",
|
96
|
-
"metadata": {},
|
97
|
-
"outputs": [],
|
98
|
-
"source": [
|
99
|
-
"df.plot(kind='line',figsize=(8,4))\n",
|
100
|
-
"plt.show()"
|
101
|
-
]
|
102
|
-
},
|
103
|
-
{
|
104
|
-
"cell_type": "code",
|
105
|
-
"execution_count": null,
|
106
|
-
"id": "ae4b74a2-ad44-4624-bd87-98f6feef4f17",
|
107
|
-
"metadata": {},
|
108
|
-
"outputs": [],
|
109
|
-
"source": [
|
110
|
-
"plt.figure(figsize=(8,4))\n",
|
111
|
-
"plt.scatter(x=df.index,y=df['Temperature'])\n",
|
112
|
-
"plt.xticks(rotation=45)\n",
|
113
|
-
"plt.show()"
|
114
|
-
]
|
115
|
-
},
|
116
|
-
{
|
117
|
-
"cell_type": "code",
|
118
|
-
"execution_count": null,
|
119
|
-
"id": "b3e047ce-c749-44e7-b250-9749649e3c1c",
|
120
|
-
"metadata": {},
|
121
|
-
"outputs": [],
|
122
|
-
"source": [
|
123
|
-
"plt.figure(figsize=(8,4))\n",
|
124
|
-
"pd.plotting.autocorrelation_plot(df['Temperature'])\n",
|
125
|
-
"plt.show()"
|
126
|
-
]
|
127
|
-
},
|
128
|
-
{
|
129
|
-
"cell_type": "code",
|
130
|
-
"execution_count": null,
|
131
|
-
"id": "dac6bf07-c177-46cc-9206-043b77abc8d3",
|
132
|
-
"metadata": {},
|
133
|
-
"outputs": [],
|
134
|
-
"source": [
|
135
|
-
"df.corr()"
|
136
|
-
]
|
137
|
-
},
|
138
|
-
{
|
139
|
-
"cell_type": "code",
|
140
|
-
"execution_count": null,
|
141
|
-
"id": "25daff75-977a-49ab-b642-f7d74dc481fb",
|
142
|
-
"metadata": {},
|
143
|
-
"outputs": [],
|
144
|
-
"source": [
|
145
|
-
"plt.figure(figsize=(3,3))\n",
|
146
|
-
"sns.heatmap(df)\n",
|
147
|
-
"plt.show()"
|
148
|
-
]
|
149
|
-
}
|
150
|
-
],
|
151
|
-
"metadata": {
|
152
|
-
"kernelspec": {
|
153
|
-
"display_name": "Python 3 (ipykernel)",
|
154
|
-
"language": "python",
|
155
|
-
"name": "python3"
|
156
|
-
},
|
157
|
-
"language_info": {
|
158
|
-
"codemirror_mode": {
|
159
|
-
"name": "ipython",
|
160
|
-
"version": 3
|
161
|
-
},
|
162
|
-
"file_extension": ".py",
|
163
|
-
"mimetype": "text/x-python",
|
164
|
-
"name": "python",
|
165
|
-
"nbconvert_exporter": "python",
|
166
|
-
"pygments_lexer": "ipython3",
|
167
|
-
"version": "3.12.4"
|
168
|
-
}
|
169
|
-
},
|
170
|
-
"nbformat": 4,
|
171
|
-
"nbformat_minor": 5
|
172
|
-
}
|