noshot 0.1.9__tar.gz → 0.2.1__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 (48) hide show
  1. {noshot-0.1.9 → noshot-0.2.1}/PKG-INFO +2 -2
  2. {noshot-0.1.9 → noshot-0.2.1}/README.md +1 -1
  3. {noshot-0.1.9 → noshot-0.2.1}/noshot.egg-info/PKG-INFO +2 -2
  4. {noshot-0.1.9 → noshot-0.2.1}/noshot.egg-info/SOURCES.txt +1 -0
  5. {noshot-0.1.9 → noshot-0.2.1}/setup.py +1 -1
  6. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/1. PCA - EDA/PCA-EDA.ipynb +2 -2
  7. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/2. KNN Classifier/KNN.ipynb +5 -5
  8. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/LDA.ipynb +1 -1
  9. noshot-0.2.1/src/noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb +87 -0
  10. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/Handling TS Data.ipynb +247 -0
  11. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/2. Feature Engineering/Feature Engineering-.ipynb +183 -0
  12. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/3. Temporal Relationships/Exploring Temporal Relationships.ipynb +172 -0
  13. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/Up-Down-Sampling.ipynb +146 -0
  14. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/Stationarity-Trend-Seasonality.ipynb +173 -0
  15. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/ACF-PACF.ipynb +77 -0
  16. noshot-0.2.1/src/noshot/data/ML TS XAI/TS/AllinOne.ipynb +12676 -0
  17. noshot-0.1.9/src/noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb +0 -129
  18. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/Handling TS Data.ipynb +0 -784
  19. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/2. Feature Engineering/Feature Engineering-.ipynb +0 -1445
  20. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/3. Temporal Relationships/Exploring Temporal Relationships.ipynb +0 -603
  21. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/Up-Down-Sampling.ipynb +0 -721
  22. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/Stationarity-Trend-Seasonality.ipynb +0 -392
  23. noshot-0.1.9/src/noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/ACF-PACF.ipynb +0 -175
  24. {noshot-0.1.9 → noshot-0.2.1}/LICENSE.txt +0 -0
  25. {noshot-0.1.9 → noshot-0.2.1}/noshot.egg-info/dependency_links.txt +0 -0
  26. {noshot-0.1.9 → noshot-0.2.1}/noshot.egg-info/not-zip-safe +0 -0
  27. {noshot-0.1.9 → noshot-0.2.1}/noshot.egg-info/top_level.txt +0 -0
  28. {noshot-0.1.9 → noshot-0.2.1}/setup.cfg +0 -0
  29. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/__init__.py +0 -0
  30. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/1. PCA - EDA/balance-scale.csv +0 -0
  31. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/1. PCA - EDA/input.txt +0 -0
  32. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/2. KNN Classifier/balance-scale.csv +0 -0
  33. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/2. KNN Classifier/input.txt +0 -0
  34. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/balance-scale.csv +0 -0
  35. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/input.txt +0 -0
  36. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/4. Linear Regression/Linear-Regression.ipynb +0 -0
  37. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/4. Linear Regression/machine-data.csv +0 -0
  38. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/5. Logistic Regression/Logistic-Regression.ipynb +0 -0
  39. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/5. Logistic Regression/wine-dataset.csv +0 -0
  40. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/ML/6. Bayesian Classifier/wine-dataset.csv +0 -0
  41. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/raw_sales.csv +0 -0
  42. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/shampoo_sales.csv +0 -0
  43. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-min-temperatures.csv +0 -0
  44. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-total-female-births.csv +0 -0
  45. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/daily-min-temperatures.csv +0 -0
  46. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/main.py +0 -0
  47. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/utils/__init__.py +0 -0
  48. {noshot-0.1.9 → noshot-0.2.1}/src/noshot/utils/shell_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: noshot
3
- Version: 0.1.9
3
+ Version: 0.2.1
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -52,4 +52,4 @@ Dynamic: summary
52
52
  ## 📦 **Installation**
53
53
  Install latest version via `pip`:
54
54
  ```sh
55
- pip install noshot==0.1.9
55
+ pip install noshot==0.2.1
@@ -27,4 +27,4 @@
27
27
  ## 📦 **Installation**
28
28
  Install latest version via `pip`:
29
29
  ```sh
30
- pip install noshot==0.1.9
30
+ pip install noshot==0.2.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: noshot
3
- Version: 0.1.9
3
+ Version: 0.2.1
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -52,4 +52,4 @@ Dynamic: summary
52
52
  ## 📦 **Installation**
53
53
  Install latest version via `pip`:
54
54
  ```sh
55
- pip install noshot==0.1.9
55
+ pip install noshot==0.2.1
@@ -23,6 +23,7 @@ src/noshot/data/ML TS XAI/ML/5. Logistic Regression/Logistic-Regression.ipynb
23
23
  src/noshot/data/ML TS XAI/ML/5. Logistic Regression/wine-dataset.csv
24
24
  src/noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb
25
25
  src/noshot/data/ML TS XAI/ML/6. Bayesian Classifier/wine-dataset.csv
26
+ src/noshot/data/ML TS XAI/TS/AllinOne.ipynb
26
27
  src/noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/Handling TS Data.ipynb
27
28
  src/noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/raw_sales.csv
28
29
  src/noshot/data/ML TS XAI/TS/2. Feature Engineering/Feature Engineering-.ipynb
@@ -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.1.9",
8
+ version="0.2.1",
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,
@@ -5,7 +5,7 @@
5
5
  "id": "8c414eda",
6
6
  "metadata": {},
7
7
  "source": [
8
- "# Machine learnings Laboratory First Lab Basic EDA and Principle components analysis"
8
+ "##### __Machine learnings Laboratory First Lab Basic EDA and Principle components analysis__"
9
9
  ]
10
10
  },
11
11
  {
@@ -102,7 +102,7 @@
102
102
  "id": "3b033918",
103
103
  "metadata": {},
104
104
  "source": [
105
- "# PCA"
105
+ "##### __PCA__"
106
106
  ]
107
107
  },
108
108
  {
@@ -5,7 +5,7 @@
5
5
  "id": "def24f4a",
6
6
  "metadata": {},
7
7
  "source": [
8
- "### __Balance Scale Dataset__"
8
+ "##### __Balance Scale Dataset__"
9
9
  ]
10
10
  },
11
11
  {
@@ -72,7 +72,7 @@
72
72
  "id": "6702687e",
73
73
  "metadata": {},
74
74
  "source": [
75
- "#### __class for [1,1,1,1] = R (predicted)__"
75
+ "##### __class for [1,1,1,1] = R (predicted)__"
76
76
  ]
77
77
  },
78
78
  {
@@ -91,7 +91,7 @@
91
91
  "id": "13d70944",
92
92
  "metadata": {},
93
93
  "source": [
94
- "### __Iris Dataset__"
94
+ "##### __Iris Dataset__"
95
95
  ]
96
96
  },
97
97
  {
@@ -151,7 +151,7 @@
151
151
  "id": "06559281",
152
152
  "metadata": {},
153
153
  "source": [
154
- "#### __class for [5.2,3.5,1.1,0.2] = virginica (predicted)__"
154
+ "##### __class for [5.2,3.5,1.1,0.2] = virginica (predicted)__"
155
155
  ]
156
156
  },
157
157
  {
@@ -170,7 +170,7 @@
170
170
  "id": "cdd56944",
171
171
  "metadata": {},
172
172
  "source": [
173
- "#### __Iris Dataset Visualization__"
173
+ "##### __Iris Dataset Visualization__"
174
174
  ]
175
175
  },
176
176
  {
@@ -32,7 +32,7 @@
32
32
  "id": "ac328950-540f-4a27-b9d4-0880058064f5",
33
33
  "metadata": {},
34
34
  "source": [
35
- "### __LDA__"
35
+ "##### __LDA__"
36
36
  ]
37
37
  },
38
38
  {
@@ -0,0 +1,87 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "939c616d-2779-4e21-adcf-1d070898d65b",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "from sklearn import datasets\n",
11
+ "from sklearn.metrics import confusion_matrix\n",
12
+ "from sklearn.model_selection import train_test_split\n",
13
+ "from sklearn.naive_bayes import GaussianNB"
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "code",
18
+ "execution_count": null,
19
+ "id": "17720a0d-e788-4b1d-b2b2-a542f6b824a2",
20
+ "metadata": {},
21
+ "outputs": [],
22
+ "source": [
23
+ "wine = datasets.load_wine()"
24
+ ]
25
+ },
26
+ {
27
+ "cell_type": "code",
28
+ "execution_count": null,
29
+ "id": "a050923e-4382-4ff7-93bf-446b117c0ef5",
30
+ "metadata": {},
31
+ "outputs": [],
32
+ "source": [
33
+ "X = wine.data\n",
34
+ "X"
35
+ ]
36
+ },
37
+ {
38
+ "cell_type": "code",
39
+ "execution_count": null,
40
+ "id": "9f1a4355-718e-40ed-b892-3e3d03c4ef3c",
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": [
44
+ "y = wine.target\n",
45
+ "y"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "execution_count": null,
51
+ "id": "dd3f31ef-c0d2-48dd-9fb7-338c10f9fbf9",
52
+ "metadata": {},
53
+ "outputs": [],
54
+ "source": [
55
+ "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 0)\n",
56
+ "\n",
57
+ "gnb = GaussianNB().fit(X_train, y_train)\n",
58
+ "gnb_predictions = gnb.predict(X_test)\n",
59
+ "accuracy = gnb.score(X_test, y_test)\n",
60
+ "accuracy\n",
61
+ "cm = confusion_matrix(y_test, gnb_predictions)\n",
62
+ "cm"
63
+ ]
64
+ }
65
+ ],
66
+ "metadata": {
67
+ "kernelspec": {
68
+ "display_name": "Python 3 (ipykernel)",
69
+ "language": "python",
70
+ "name": "python3"
71
+ },
72
+ "language_info": {
73
+ "codemirror_mode": {
74
+ "name": "ipython",
75
+ "version": 3
76
+ },
77
+ "file_extension": ".py",
78
+ "mimetype": "text/x-python",
79
+ "name": "python",
80
+ "nbconvert_exporter": "python",
81
+ "pygments_lexer": "ipython3",
82
+ "version": "3.12.4"
83
+ }
84
+ },
85
+ "nbformat": 4,
86
+ "nbformat_minor": 5
87
+ }
@@ -0,0 +1,247 @@
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('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
+ }
@@ -0,0 +1,183 @@
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
+ }