noshot 0.3.1__py3-none-any.whl → 0.3.2__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 (36) hide show
  1. noshot/data/ML TS XAI/ML/1. PCA - EDA/PCA-EDA.ipynb +207 -0
  2. noshot/data/ML TS XAI/ML/1. PCA - EDA/balance-scale.csv +626 -0
  3. noshot/data/ML TS XAI/ML/1. PCA - EDA/input.txt +625 -0
  4. noshot/data/ML TS XAI/ML/2. KNN Classifier/KNN.ipynb +287 -0
  5. noshot/data/ML TS XAI/ML/2. KNN Classifier/balance-scale.csv +626 -0
  6. noshot/data/ML TS XAI/ML/2. KNN Classifier/input.txt +625 -0
  7. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/LDA.ipynb +83 -0
  8. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/balance-scale.csv +626 -0
  9. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/input.txt +625 -0
  10. noshot/data/ML TS XAI/ML/4. Linear Regression/Linear-Regression.ipynb +117 -0
  11. noshot/data/ML TS XAI/ML/4. Linear Regression/machine-data.csv +210 -0
  12. noshot/data/ML TS XAI/ML/5. Logistic Regression/Logistic-Regression.ipynb +137 -0
  13. noshot/data/ML TS XAI/ML/5. Logistic Regression/wine-dataset.csv +179 -0
  14. noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb +87 -0
  15. noshot/data/ML TS XAI/ML/6. Bayesian Classifier/wine-dataset.csv +179 -0
  16. noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/Handling TS Data.ipynb +247 -0
  17. noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/raw_sales.csv +29581 -0
  18. noshot/data/ML TS XAI/TS/2. Feature Engineering/Feature Engineering-.ipynb +183 -0
  19. noshot/data/ML TS XAI/TS/3. Temporal Relationships/Exploring Temporal Relationships.ipynb +172 -0
  20. noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/Up-Down-Sampling.ipynb +146 -0
  21. noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/shampoo_sales.csv +37 -0
  22. noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/Stationarity-Trend-Seasonality.ipynb +173 -0
  23. noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-min-temperatures.csv +3651 -0
  24. noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-total-female-births.csv +366 -0
  25. noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/ACF-PACF.ipynb +77 -0
  26. noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/daily-min-temperatures.csv +3651 -0
  27. noshot/data/ML TS XAI/TS/AllinOne.ipynb +12676 -0
  28. noshot/main.py +18 -18
  29. noshot/utils/__init__.py +2 -2
  30. noshot/utils/shell_utils.py +56 -56
  31. {noshot-0.3.1.dist-info → noshot-0.3.2.dist-info}/LICENSE.txt +20 -20
  32. {noshot-0.3.1.dist-info → noshot-0.3.2.dist-info}/METADATA +55 -55
  33. noshot-0.3.2.dist-info/RECORD +36 -0
  34. noshot-0.3.1.dist-info/RECORD +0 -9
  35. {noshot-0.3.1.dist-info → noshot-0.3.2.dist-info}/WHEEL +0 -0
  36. {noshot-0.3.1.dist-info → noshot-0.3.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,207 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "8c414eda",
6
+ "metadata": {},
7
+ "source": [
8
+ "##### __Machine learnings Laboratory First Lab Basic EDA and Principle components analysis__"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "code",
13
+ "execution_count": null,
14
+ "id": "1919dce4",
15
+ "metadata": {},
16
+ "outputs": [],
17
+ "source": [
18
+ "import pandas as pd\n",
19
+ "import numpy as np\n",
20
+ "import matplotlib.pyplot as plt\n",
21
+ "from sklearn.preprocessing import StandardScaler\n",
22
+ "from sklearn.decomposition import PCA\n",
23
+ "import warnings\n",
24
+ "warnings.filterwarnings('ignore')"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "code",
29
+ "execution_count": null,
30
+ "id": "459c19c9",
31
+ "metadata": {},
32
+ "outputs": [],
33
+ "source": [
34
+ "df = pd.read_table('input.txt', delimiter = ',', names = ['class name', 'left-weight', 'left-distance', 'right-weight', 'right-distance'])\n",
35
+ "#df = pd.read_csv('balance-scale.csv')\n",
36
+ "df.head()"
37
+ ]
38
+ },
39
+ {
40
+ "cell_type": "code",
41
+ "execution_count": null,
42
+ "id": "4a1f3399",
43
+ "metadata": {},
44
+ "outputs": [],
45
+ "source": [
46
+ "print(\"Shape\\t Size\")\n",
47
+ "print(df.shape, df.size)\n",
48
+ "df.dtypes"
49
+ ]
50
+ },
51
+ {
52
+ "cell_type": "code",
53
+ "execution_count": null,
54
+ "id": "ceb17e01",
55
+ "metadata": {},
56
+ "outputs": [],
57
+ "source": [
58
+ "df.describe()"
59
+ ]
60
+ },
61
+ {
62
+ "cell_type": "code",
63
+ "execution_count": null,
64
+ "id": "c3950e04",
65
+ "metadata": {},
66
+ "outputs": [],
67
+ "source": [
68
+ "df.info()"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "code",
73
+ "execution_count": null,
74
+ "id": "e242d2e1",
75
+ "metadata": {},
76
+ "outputs": [],
77
+ "source": [
78
+ "plt.hist(df['class name'], color = 'green', label = 'Frequency Distribution')\n",
79
+ "plt.legend()\n",
80
+ "plt.title(\"Class Wise Count ['L', 'B', 'R']\")\n",
81
+ "plt.show()"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "code",
86
+ "execution_count": null,
87
+ "id": "37654636",
88
+ "metadata": {},
89
+ "outputs": [],
90
+ "source": [
91
+ "fig, axs = plt.subplots(2,2)\n",
92
+ "axs[0][0].hist(df['left-weight'], color = 'orange', label = 'Left-Weight')\n",
93
+ "axs[0][1].hist(df['left-distance'], color = 'red', label = 'Lefft-distance')\n",
94
+ "axs[1][0].hist(df['right-weight'], color = 'green',label = 'right-weight')\n",
95
+ "axs[1][1].hist(df['right-distance'], color = 'indigo', label = 'right-distance')\n",
96
+ "fig.legend(loc = 'upper left')\n",
97
+ "fig.suptitle(\"Histogram For Features\")"
98
+ ]
99
+ },
100
+ {
101
+ "cell_type": "markdown",
102
+ "id": "3b033918",
103
+ "metadata": {},
104
+ "source": [
105
+ "##### __PCA__"
106
+ ]
107
+ },
108
+ {
109
+ "cell_type": "code",
110
+ "execution_count": null,
111
+ "id": "b9d4bb7e",
112
+ "metadata": {},
113
+ "outputs": [],
114
+ "source": [
115
+ "feature = ['left-weight','left-distance','right-weight','right-distance']\n",
116
+ "x = df.loc[:, feature]\n",
117
+ "y = df.loc[:, 'class name']"
118
+ ]
119
+ },
120
+ {
121
+ "cell_type": "code",
122
+ "execution_count": null,
123
+ "id": "de2b55cc",
124
+ "metadata": {},
125
+ "outputs": [],
126
+ "source": [
127
+ "x = StandardScaler().fit_transform(x)\n",
128
+ "pca = PCA(n_components = 2)\n",
129
+ "pct = pca.fit_transform(x)"
130
+ ]
131
+ },
132
+ {
133
+ "cell_type": "code",
134
+ "execution_count": null,
135
+ "id": "06bf0d31",
136
+ "metadata": {},
137
+ "outputs": [],
138
+ "source": [
139
+ "principal_df = pd.DataFrame(pct,columns=['pc1','pc2'])\n",
140
+ "print(\"principal-df:\\n\",principal_df)"
141
+ ]
142
+ },
143
+ {
144
+ "cell_type": "code",
145
+ "execution_count": null,
146
+ "id": "7dab85de",
147
+ "metadata": {},
148
+ "outputs": [],
149
+ "source": [
150
+ "finaldf= pd.concat([principal_df,df[['class name']]],axis=1)\n",
151
+ "print(\"finaldf:\\n\",finaldf)"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": null,
157
+ "id": "026ab3b1",
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "finaldf.head()"
162
+ ]
163
+ },
164
+ {
165
+ "cell_type": "code",
166
+ "execution_count": null,
167
+ "id": "53d0455b",
168
+ "metadata": {},
169
+ "outputs": [],
170
+ "source": [
171
+ "fig = plt.figure(figsize = (8, 8))\n",
172
+ "ax = fig.add_subplot(1, 1, 1)\n",
173
+ "ax.set_xlabel('Principal Component 1', fontsize = 15)\n",
174
+ "ax.set_ylabel('Principal Component 2', fontsize = 15)\n",
175
+ "ax.set_title('2 component PCA', fontsize = 20)\n",
176
+ "targets = ['L','B','R']\n",
177
+ "colors = ['r', 'g','b']\n",
178
+ "for target, color in zip(targets, colors):\n",
179
+ " indicesToKeep = finaldf['class name'] == target\n",
180
+ " ax.scatter(finaldf.loc[indicesToKeep, 'pc1'], finaldf.loc[indicesToKeep, 'pc2'], c = color, s = 50)\n",
181
+ "ax.legend(targets)\n",
182
+ "ax.grid()"
183
+ ]
184
+ }
185
+ ],
186
+ "metadata": {
187
+ "kernelspec": {
188
+ "display_name": "Python 3 (ipykernel)",
189
+ "language": "python",
190
+ "name": "python3"
191
+ },
192
+ "language_info": {
193
+ "codemirror_mode": {
194
+ "name": "ipython",
195
+ "version": 3
196
+ },
197
+ "file_extension": ".py",
198
+ "mimetype": "text/x-python",
199
+ "name": "python",
200
+ "nbconvert_exporter": "python",
201
+ "pygments_lexer": "ipython3",
202
+ "version": "3.12.4"
203
+ }
204
+ },
205
+ "nbformat": 4,
206
+ "nbformat_minor": 5
207
+ }