noshot 6.0.0__py3-none-any.whl → 8.0.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.
Files changed (62) hide show
  1. noshot/data/ML TS XAI/ML/CNN(Image_for_Folders_5).ipynb +201 -0
  2. noshot/data/ML TS XAI/ML/CNN(Image_form_Folder_2).ipynb +201 -0
  3. noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Balance Scale Dataset).ipynb +147 -0
  4. noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Rice Dataset).ipynb +181 -0
  5. noshot/data/ML TS XAI/ML/ML 1/10. HMM Veterbi.ipynb +152 -0
  6. noshot/data/ML TS XAI/ML/ML 1/2. KNN (Balance Scale Dataset).ipynb +117 -0
  7. noshot/data/ML TS XAI/ML/ML 1/2. KNN (Iris Dataset).ipynb +156 -0
  8. noshot/data/ML TS XAI/ML/ML 1/2. KNN (Sobar-72 Dataset).ipynb +215 -0
  9. noshot/data/ML TS XAI/ML/ML 1/3. LDA (Balance Scale Dataset).ipynb +78 -0
  10. noshot/data/ML TS XAI/ML/ML 1/3. LDA (NPHA Doctor Visits Dataset).ipynb +114 -0
  11. noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Machine Dataset).ipynb +115 -0
  12. noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Real Estate Dataset).ipynb +146 -0
  13. noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Magic04 Dataset).ipynb +130 -0
  14. noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Wine Dataset).ipynb +112 -0
  15. noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Agaricus Lepiota Dataset).ipynb +118 -0
  16. noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Wine Dataset).ipynb +89 -0
  17. noshot/data/ML TS XAI/ML/ML 1/7. SVM (Rice Dataset).ipynb +120 -0
  18. noshot/data/ML TS XAI/ML/ML 1/8. FeedForward NN (Sobar72 Dataset).ipynb +262 -0
  19. noshot/data/ML TS XAI/ML/ML 1/9. CNN (Cifar10 Dataset).ipynb +156 -0
  20. noshot/data/ML TS XAI/ML/ML 2/1. PCA.ipynb +162 -0
  21. noshot/data/ML TS XAI/ML/ML 2/10. CNN.ipynb +100 -0
  22. noshot/data/ML TS XAI/ML/ML 2/11. HMM.ipynb +336 -0
  23. noshot/data/ML TS XAI/ML/ML 2/2. KNN.ipynb +149 -0
  24. noshot/data/ML TS XAI/ML/ML 2/3. LDA.ipynb +132 -0
  25. noshot/data/ML TS XAI/ML/ML 2/4. Linear Regression.ipynb +86 -0
  26. noshot/data/ML TS XAI/ML/ML 2/5. Logistic Regression.ipynb +115 -0
  27. noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Titanic).ipynb +196 -0
  28. noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Wine).ipynb +98 -0
  29. noshot/data/ML TS XAI/ML/ML 2/7. SVM Linear.ipynb +109 -0
  30. noshot/data/ML TS XAI/ML/ML 2/8. SVM Non-Linear.ipynb +195 -0
  31. noshot/data/ML TS XAI/ML/ML 2/9. FNN With Regularization.ipynb +189 -0
  32. noshot/data/ML TS XAI/ML/ML 2/9. FNN Without Regularization.ipynb +197 -0
  33. noshot/data/ML TS XAI/ML/ML 2/All in One Lab CIA 1 Q.ipynb +1087 -0
  34. noshot/data/ML TS XAI/ML/ML 3 (Latest)/1. PCA EDA.ipynb +274 -0
  35. noshot/data/ML TS XAI/ML/ML 3 (Latest)/10. CNN.ipynb +170 -0
  36. noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 2.ipynb +1087 -0
  37. noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 3.ipynb +178 -0
  38. noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 4.ipynb +185 -0
  39. noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM.ipynb +106 -0
  40. noshot/data/ML TS XAI/ML/ML 3 (Latest)/2. KNN.ipynb +177 -0
  41. noshot/data/ML TS XAI/ML/ML 3 (Latest)/3. LDA.ipynb +195 -0
  42. noshot/data/ML TS XAI/ML/ML 3 (Latest)/4. Linear Regression.ipynb +267 -0
  43. noshot/data/ML TS XAI/ML/ML 3 (Latest)/5. Logistic Regression.ipynb +104 -0
  44. noshot/data/ML TS XAI/ML/ML 3 (Latest)/6. Bayesian Classifier.ipynb +109 -0
  45. noshot/data/ML TS XAI/ML/ML 3 (Latest)/7. SVM.ipynb +220 -0
  46. noshot/data/ML TS XAI/ML/ML 3 (Latest)/8. MLP.ipynb +99 -0
  47. noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge - Lasso.ipynb +211 -0
  48. noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge Lasso 2.ipynb +99 -0
  49. noshot/data/ML TS XAI/ML/ML 3 (Latest)/Image Load Example.ipynb +118 -0
  50. noshot/data/ML TS XAI/ML/ML 3 (Latest)/Updated_Untitled.ipynb +603 -0
  51. noshot/data/ML TS XAI/ML/Rolls Royce AllinOne.ipynb +691 -0
  52. {noshot-6.0.0.dist-info → noshot-8.0.0.dist-info}/METADATA +1 -1
  53. noshot-8.0.0.dist-info/RECORD +60 -0
  54. {noshot-6.0.0.dist-info → noshot-8.0.0.dist-info}/WHEEL +1 -1
  55. noshot/data/ML TS XAI/XAI/Q1.ipynb +0 -377
  56. noshot/data/ML TS XAI/XAI/Q2.ipynb +0 -362
  57. noshot/data/ML TS XAI/XAI/Q3.ipynb +0 -637
  58. noshot/data/ML TS XAI/XAI/Q4.ipynb +0 -206
  59. noshot/data/ML TS XAI/XAI/Q5.ipynb +0 -1018
  60. noshot-6.0.0.dist-info/RECORD +0 -14
  61. {noshot-6.0.0.dist-info → noshot-8.0.0.dist-info}/licenses/LICENSE.txt +0 -0
  62. {noshot-6.0.0.dist-info → noshot-8.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,274 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "d96121f7",
6
+ "metadata": {},
7
+ "source": [
8
+ "replaced matplot with seaborn\n",
9
+ "rotated plt.xticks(rotation=90)\n",
10
+ "scatterplot for city-mpg vs highwaympg instead of bar plot\n",
11
+ "Added a Missing default dict for all values\n",
12
+ "taken length,width,height for 2 Component PCA"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": null,
18
+ "id": "fb8ab134",
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "import matplotlib.pyplot as plt\n",
23
+ "import pandas as pd\n",
24
+ "import numpy as np"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "code",
29
+ "execution_count": null,
30
+ "id": "7b0ed5b3",
31
+ "metadata": {},
32
+ "outputs": [],
33
+ "source": [
34
+ "df = pd.read_csv(\"Automobile_data.csv\")"
35
+ ]
36
+ },
37
+ {
38
+ "cell_type": "code",
39
+ "execution_count": null,
40
+ "id": "fec34f55-5fe5-4fb6-bcc0-f4055bb13b1b",
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": []
44
+ },
45
+ {
46
+ "cell_type": "code",
47
+ "execution_count": null,
48
+ "id": "184f6841-fc52-4ca0-b11f-b05917f9318f",
49
+ "metadata": {},
50
+ "outputs": [],
51
+ "source": [
52
+ "df.describe()"
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": null,
58
+ "id": "ef71509f",
59
+ "metadata": {},
60
+ "outputs": [],
61
+ "source": [
62
+ "df.head"
63
+ ]
64
+ },
65
+ {
66
+ "cell_type": "code",
67
+ "execution_count": null,
68
+ "id": "fdf19690",
69
+ "metadata": {},
70
+ "outputs": [],
71
+ "source": [
72
+ "from collections import defaultdict\n",
73
+ "Missing = defaultdict(int)\n",
74
+ "for x in df:\n",
75
+ " for y in df[x]:\n",
76
+ " if y == \"?\":\n",
77
+ " Missing[x] +=1"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "code",
82
+ "execution_count": null,
83
+ "id": "086900c0",
84
+ "metadata": {},
85
+ "outputs": [],
86
+ "source": [
87
+ "Missing"
88
+ ]
89
+ },
90
+ {
91
+ "cell_type": "code",
92
+ "execution_count": null,
93
+ "id": "dd6202b2",
94
+ "metadata": {},
95
+ "outputs": [],
96
+ "source": [
97
+ "df.shape"
98
+ ]
99
+ },
100
+ {
101
+ "cell_type": "code",
102
+ "execution_count": null,
103
+ "id": "a1db07e9",
104
+ "metadata": {},
105
+ "outputs": [],
106
+ "source": [
107
+ "df.dtypes"
108
+ ]
109
+ },
110
+ {
111
+ "cell_type": "code",
112
+ "execution_count": null,
113
+ "id": "173511bb",
114
+ "metadata": {},
115
+ "outputs": [],
116
+ "source": [
117
+ "plt.figure(figsize=(12,6))\n",
118
+ "sns.countplot(x='make', data=df)\n",
119
+ "plt.xlabel('Make')\n",
120
+ "plt.ylabel('Distribution')\n",
121
+ "plt.xticks(rotation=60)\n",
122
+ "plt.title('Make Distribution')"
123
+ ]
124
+ },
125
+ {
126
+ "cell_type": "code",
127
+ "execution_count": null,
128
+ "id": "a2b24412",
129
+ "metadata": {},
130
+ "outputs": [],
131
+ "source": [
132
+ "plt.figure(figsize=(12,6))\n",
133
+ "sns.countplot(x='make', data=df)\n",
134
+ "plt.xlabel('Aspiration')\n",
135
+ "plt.ylabel('Distribution')\n",
136
+ "plt.xticks(rotation=60)\n",
137
+ "plt.title('Aspiration Distribution')"
138
+ ]
139
+ },
140
+ {
141
+ "cell_type": "code",
142
+ "execution_count": null,
143
+ "id": "8691ca0d",
144
+ "metadata": {},
145
+ "outputs": [],
146
+ "source": [
147
+ "plt.figure(figsize=(12,6))\n",
148
+ "sns.lineplot(data=df[\"wheel-base\"], linewidth=2.5,color=\"orange\")\n",
149
+ "plt.xlabel('Wheel Base')\n",
150
+ "plt.ylabel('Distribution')\n",
151
+ "plt.title('Wheel Base Distribution')"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": null,
157
+ "id": "a955e558",
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "plt.figure(figsize=(12,6))\n",
162
+ "sns.scatterplot(x=df[\"city-mpg\"], y=df[\"highway-mpg\"])\n",
163
+ "plt.xlabel('Wheel Base')\n",
164
+ "plt.ylabel('Distribution')\n",
165
+ "plt.title('Wheel Base Distribution')"
166
+ ]
167
+ },
168
+ {
169
+ "cell_type": "code",
170
+ "execution_count": null,
171
+ "id": "9fa0a175",
172
+ "metadata": {},
173
+ "outputs": [],
174
+ "source": [
175
+ "x = df.iloc[:,10:13]"
176
+ ]
177
+ },
178
+ {
179
+ "cell_type": "code",
180
+ "execution_count": null,
181
+ "id": "6ab98574",
182
+ "metadata": {},
183
+ "outputs": [],
184
+ "source": [
185
+ "x"
186
+ ]
187
+ },
188
+ {
189
+ "cell_type": "code",
190
+ "execution_count": null,
191
+ "id": "264750f2",
192
+ "metadata": {},
193
+ "outputs": [],
194
+ "source": [
195
+ "df[\"body-style\"].unique()"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type": "code",
200
+ "execution_count": null,
201
+ "id": "8008a442",
202
+ "metadata": {},
203
+ "outputs": [],
204
+ "source": [
205
+ "from sklearn.preprocessing import StandardScaler\n",
206
+ "from sklearn.decomposition import PCA\n",
207
+ "\n",
208
+ "y = df[\"body-style\"]\n",
209
+ "x = StandardScaler().fit_transform(x)\n",
210
+ "pca = PCA(n_components=2)\n",
211
+ "pct = pca.fit_transform(x)\n",
212
+ "\n",
213
+ "principal_df = pd.DataFrame(pct,columns=['pc1','pc2'])\n",
214
+ "print(\"principal-df:\\n\",principal_df)\n",
215
+ "\n",
216
+ "finaldf= pd.concat([principal_df,df[\"body-style\"]],axis=1)\n",
217
+ "print(\"finaldf:\\n\",finaldf)\n",
218
+ "\n",
219
+ "finaldf.head()"
220
+ ]
221
+ },
222
+ {
223
+ "cell_type": "code",
224
+ "execution_count": null,
225
+ "id": "17a39e75",
226
+ "metadata": {},
227
+ "outputs": [],
228
+ "source": [
229
+ "\n",
230
+ "fig = plt.figure(figsize = (8,8))\n",
231
+ "ax = fig.add_subplot(1,1,1)\n",
232
+ "ax.set_xlabel('Principal Component 1', fontsize = 15)\n",
233
+ "ax.set_ylabel('Principal Component 2', fontsize = 15)\n",
234
+ "ax.set_title('2 component PCA', fontsize = 20)\n",
235
+ "targets = df[\"body-style\"].unique()\n",
236
+ "colors = ['r', 'g','b','orange','yellow']\n",
237
+ "for target, color in zip(targets,colors):\n",
238
+ " indicesToKeep = finaldf[\"body-style\"] == target\n",
239
+ " ax.scatter(finaldf.loc[indicesToKeep, 'pc1'], finaldf.loc[indicesToKeep, 'pc2'], c = color, s = 50)\n",
240
+ " ax.legend(['Front','Rear'])\n",
241
+ " ax.grid()"
242
+ ]
243
+ },
244
+ {
245
+ "cell_type": "code",
246
+ "execution_count": null,
247
+ "id": "9eccee2c",
248
+ "metadata": {},
249
+ "outputs": [],
250
+ "source": []
251
+ }
252
+ ],
253
+ "metadata": {
254
+ "kernelspec": {
255
+ "display_name": "Python 3 (ipykernel)",
256
+ "language": "python",
257
+ "name": "python3"
258
+ },
259
+ "language_info": {
260
+ "codemirror_mode": {
261
+ "name": "ipython",
262
+ "version": 3
263
+ },
264
+ "file_extension": ".py",
265
+ "mimetype": "text/x-python",
266
+ "name": "python",
267
+ "nbconvert_exporter": "python",
268
+ "pygments_lexer": "ipython3",
269
+ "version": "3.12.4"
270
+ }
271
+ },
272
+ "nbformat": 4,
273
+ "nbformat_minor": 5
274
+ }
@@ -0,0 +1,170 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {
7
+ "colab": {
8
+ "base_uri": "https://localhost:8080/",
9
+ "height": 950
10
+ },
11
+ "id": "b0LKhNW8Gj66",
12
+ "outputId": "44c10b03-2311-42ae-c173-e5ab8802c8bb"
13
+ },
14
+ "outputs": [],
15
+ "source": [
16
+ "import tensorflow as tf\n",
17
+ "from tensorflow.keras import layers, models\n",
18
+ "from tensorflow.keras.datasets import mnist\n",
19
+ "from tensorflow.keras.utils import to_categorical\n",
20
+ "import matplotlib.pyplot as plt\n",
21
+ "\n",
22
+ "(train_images, train_labels), (test_images, test_labels) = mnist.load_data()\n",
23
+ "\n",
24
+ "train_images = train_images.reshape((60000, 28, 28, 1)).astype('float32') / 255\n",
25
+ "test_images = test_images.reshape((10000, 28, 28, 1)).astype('float32') / 255\n",
26
+ "\n",
27
+ "train_labels = to_categorical(train_labels)\n",
28
+ "test_labels = to_categorical(test_labels)\n",
29
+ "\n",
30
+ "model = models.Sequential([\n",
31
+ " layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),\n",
32
+ " layers.MaxPooling2D((2, 2)),\n",
33
+ "\n",
34
+ " layers.Conv2D(64, (3, 3), activation='relu'),\n",
35
+ " layers.MaxPooling2D((2, 2)),\n",
36
+ "\n",
37
+ " layers.Conv2D(64, (3, 3), activation='relu'),\n",
38
+ "\n",
39
+ " layers.Flatten(),\n",
40
+ "\n",
41
+ " layers.Dense(64, activation='relu'),\n",
42
+ " layers.Dense(10, activation='softmax')\n",
43
+ "\n",
44
+ "model.compile(optimizer='adam',\n",
45
+ " loss='categorical_crossentropy',\n",
46
+ " metrics=['accuracy'])\n",
47
+ "\n",
48
+ "history = model.fit(train_images, train_labels,\n",
49
+ " epochs=10,\n",
50
+ " batch_size=64,\n",
51
+ " validation_data=(test_images, test_labels))\n",
52
+ "\n",
53
+ "\n",
54
+ "test_loss, test_acc = model.evaluate(test_images, test_labels)\n",
55
+ "print(f'Test accuracy: {test_acc}')\n",
56
+ "\n",
57
+ "plt.plot(history.history['accuracy'], label='accuracy')\n",
58
+ "plt.plot(history.history['val_accuracy'], label='val_accuracy')\n",
59
+ "plt.xlabel('Epoch')\n",
60
+ "plt.ylabel('Accuracy')\n",
61
+ "plt.ylim([0.9, 1])\n",
62
+ "plt.legend(loc='lower right')\n",
63
+ "plt.show()"
64
+ ]
65
+ },
66
+ {
67
+ "cell_type": "code",
68
+ "execution_count": null,
69
+ "metadata": {
70
+ "colab": {
71
+ "base_uri": "https://localhost:8080/",
72
+ "height": 490
73
+ },
74
+ "id": "xksHSflCK28c",
75
+ "outputId": "1f629cb2-ad9d-4e2d-c8e9-65122b60b720"
76
+ },
77
+ "outputs": [],
78
+ "source": [
79
+ "plt.plot(history.history['loss'], label='Training Loss')\n",
80
+ "plt.plot(history.history['val_loss'], label='Validation Loss')\n",
81
+ "plt.title('Model Loss')\n",
82
+ "plt.xlabel('Epoch')\n",
83
+ "plt.ylabel('Loss')\n",
84
+ "plt.legend(loc='upper right')"
85
+ ]
86
+ },
87
+ {
88
+ "cell_type": "code",
89
+ "execution_count": null,
90
+ "metadata": {
91
+ "id": "iuB44zyhK8FK"
92
+ },
93
+ "outputs": [],
94
+ "source": [
95
+ "import tensorflow as tf\n",
96
+ "from tensorflow.keras.models import Sequential\n",
97
+ "from tensorflow.keras.layers import Conv2D, Dense, Flatten\n",
98
+ "from tensorflow.keras.datasets import mnist\n",
99
+ "from tensorflow.keras.utils import to_categorical\n",
100
+ "import matplotlib.pyplot as plt\n",
101
+ "\n",
102
+ "(train_images, train_labels), (test_images, test_labels) = mnist.load_data()\n",
103
+ "\n",
104
+ "train_images = train_images.reshape((60000, 28, 28, 1)).astype('float32') / 255\n",
105
+ "test_images = test_images.reshape((10000, 28, 28, 1)).astype('float32') / 255\n",
106
+ "\n",
107
+ "train_labels = to_categorical(train_labels)\n",
108
+ "test_labels = to_categorical(test_labels)\n",
109
+ "\n",
110
+ "model = Sequential([\n",
111
+ " Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),\n",
112
+ " Flatten(),\n",
113
+ " Dense(64, activation='relu'),\n",
114
+ " Dense(10, activation='softmax')\n",
115
+ "])\n",
116
+ "model.compile(optimizer='adam',\n",
117
+ " loss='categorical_crossentropy',\n",
118
+ " metrics=['accuracy'])\n",
119
+ "\n",
120
+ "history = model.fit(train_images, train_labels,\n",
121
+ " epochs=2,\n",
122
+ " batch_size=64,\n",
123
+ " validation_data=(test_images, test_labels))\n",
124
+ "\n",
125
+ "\n",
126
+ "test_loss, test_acc = model.evaluate(test_images, test_labels)\n",
127
+ "print(f'Test accuracy: {test_acc}')\n",
128
+ "\n",
129
+ "plt.plot(history.history['accuracy'], label='accuracy')\n",
130
+ "plt.plot(history.history['val_accuracy'], label='val_accuracy')\n",
131
+ "plt.xlabel('Epoch')\n",
132
+ "plt.ylabel('Accuracy')\n",
133
+ "plt.ylim([0.9, 1])\n",
134
+ "plt.legend(loc='lower right')\n",
135
+ "plt.show()"
136
+ ]
137
+ },
138
+ {
139
+ "cell_type": "code",
140
+ "execution_count": null,
141
+ "metadata": {},
142
+ "outputs": [],
143
+ "source": []
144
+ }
145
+ ],
146
+ "metadata": {
147
+ "colab": {
148
+ "provenance": []
149
+ },
150
+ "kernelspec": {
151
+ "display_name": "Python 3 (ipykernel)",
152
+ "language": "python",
153
+ "name": "python3"
154
+ },
155
+ "language_info": {
156
+ "codemirror_mode": {
157
+ "name": "ipython",
158
+ "version": 3
159
+ },
160
+ "file_extension": ".py",
161
+ "mimetype": "text/x-python",
162
+ "name": "python",
163
+ "nbconvert_exporter": "python",
164
+ "pygments_lexer": "ipython3",
165
+ "version": "3.12.4"
166
+ }
167
+ },
168
+ "nbformat": 4,
169
+ "nbformat_minor": 4
170
+ }