noshot 4.0.0__py3-none-any.whl → 6.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.
- noshot/data/ML TS XAI/XAI/Q1.ipynb +377 -0
- noshot/data/ML TS XAI/XAI/Q2.ipynb +362 -0
- noshot/data/ML TS XAI/XAI/Q3.ipynb +637 -0
- noshot/data/ML TS XAI/XAI/Q4.ipynb +206 -0
- noshot/data/ML TS XAI/XAI/Q5.ipynb +1018 -0
- {noshot-4.0.0.dist-info → noshot-6.0.0.dist-info}/METADATA +1 -1
- noshot-6.0.0.dist-info/RECORD +14 -0
- noshot/data/ML TS XAI/ML/ML Lab CIA 2 (I Found Only This Check)/Copy_of_Pistachio_csv.ipynb +0 -269
- noshot/data/ML TS XAI/ML/ML Lab CIA 2 (I Found Only This Check)/weatherAUS.ipynb +0 -155
- noshot/data/ML TS XAI/ML/Main/1. EDA-PCA (Balance Scale Dataset).ipynb +0 -139
- noshot/data/ML TS XAI/ML/Main/1. EDA-PCA (Rice Dataset).ipynb +0 -181
- noshot/data/ML TS XAI/ML/Main/10. HMM Veterbi.ipynb +0 -228
- noshot/data/ML TS XAI/ML/Main/2. KNN (Balance Scale Dataset).ipynb +0 -117
- noshot/data/ML TS XAI/ML/Main/2. KNN (Iris Dataset).ipynb +0 -165
- noshot/data/ML TS XAI/ML/Main/2. KNN (Sobar-72 Dataset).ipynb +0 -251
- noshot/data/ML TS XAI/ML/Main/3. LDA (Balance Scale Dataset).ipynb +0 -78
- noshot/data/ML TS XAI/ML/Main/3. LDA (NPHA Doctor Visits Dataset).ipynb +0 -114
- noshot/data/ML TS XAI/ML/Main/4. Linear Regression (Machine Dataset).ipynb +0 -115
- noshot/data/ML TS XAI/ML/Main/4. Linear Regression (Real Estate Dataset).ipynb +0 -159
- noshot/data/ML TS XAI/ML/Main/5. Logistic Regression (Magic04 Dataset).ipynb +0 -200
- noshot/data/ML TS XAI/ML/Main/5. Logistic Regression (Wine Dataset).ipynb +0 -112
- noshot/data/ML TS XAI/ML/Main/6. Naive Bayes Classifier (Agaricus Lepiota Dataset).ipynb +0 -153
- noshot/data/ML TS XAI/ML/Main/6. Naive Bayes Classifier (Wine Dataset).ipynb +0 -89
- noshot/data/ML TS XAI/ML/Main/7. SVM (Rice Dataset).ipynb +0 -208
- noshot/data/ML TS XAI/ML/Main/8. FeedForward NN (Sobar72 Dataset).ipynb +0 -260
- noshot/data/ML TS XAI/ML/Main/9. CNN (Cifar10 Dataset).ipynb +0 -238
- noshot/data/ML TS XAI/ML/Main/data/agaricus-lepiota.data +0 -8124
- noshot/data/ML TS XAI/ML/Main/data/balance-scale.txt +0 -625
- noshot/data/ML TS XAI/ML/Main/data/doctor-visits.csv +0 -715
- noshot/data/ML TS XAI/ML/Main/data/iris.csv +0 -151
- noshot/data/ML TS XAI/ML/Main/data/machine-data.csv +0 -210
- noshot/data/ML TS XAI/ML/Main/data/magic04.data +0 -19020
- noshot/data/ML TS XAI/ML/Main/data/real-estate.xlsx +0 -0
- noshot/data/ML TS XAI/ML/Main/data/rice.arff +0 -3826
- noshot/data/ML TS XAI/ML/Main/data/sobar-72.csv +0 -73
- noshot/data/ML TS XAI/ML/Main/data/wine-dataset.csv +0 -179
- noshot/data/ML TS XAI/ML/Other Codes.ipynb +0 -158
- noshot/data/ML TS XAI/ML/Rolls Royce AllinOne.ipynb +0 -691
- noshot-4.0.0.dist-info/RECORD +0 -40
- {noshot-4.0.0.dist-info → noshot-6.0.0.dist-info}/WHEEL +0 -0
- {noshot-4.0.0.dist-info → noshot-6.0.0.dist-info}/licenses/LICENSE.txt +0 -0
- {noshot-4.0.0.dist-info → noshot-6.0.0.dist-info}/top_level.txt +0 -0
@@ -1,238 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": null,
|
6
|
-
"metadata": {
|
7
|
-
"id": "wHmdCsrz61l7"
|
8
|
-
},
|
9
|
-
"outputs": [],
|
10
|
-
"source": [
|
11
|
-
"import tensorflow as tf\n",
|
12
|
-
"from tensorflow import keras\n",
|
13
|
-
"from tensorflow.keras import layers\n",
|
14
|
-
"import numpy as np\n",
|
15
|
-
"from keras.datasets import cifar10\n",
|
16
|
-
"import tensorflow as tf\n",
|
17
|
-
"from keras.preprocessing import image\n",
|
18
|
-
"from tensorflow.keras.preprocessing.image import ImageDataGenerator\n",
|
19
|
-
"from keras.models import Sequential\n",
|
20
|
-
"from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Dropout, BatchNormalization\n",
|
21
|
-
"from keras.utils import to_categorical\n",
|
22
|
-
"from keras.applications.vgg19 import VGG19\n",
|
23
|
-
"from tensorflow.keras.optimizers import RMSprop\n",
|
24
|
-
"from keras.datasets import cifar10\n",
|
25
|
-
"from sklearn.metrics import classification_report, confusion_matrix\n",
|
26
|
-
"from keras.callbacks import EarlyStopping, ReduceLROnPlateau\n",
|
27
|
-
"import os\n",
|
28
|
-
"import warnings\n",
|
29
|
-
"warnings.filterwarnings('ignore')"
|
30
|
-
]
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"cell_type": "code",
|
34
|
-
"execution_count": null,
|
35
|
-
"metadata": {
|
36
|
-
"colab": {
|
37
|
-
"base_uri": "https://localhost:8080/"
|
38
|
-
},
|
39
|
-
"id": "dghWl91B66Ey",
|
40
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
41
|
-
},
|
42
|
-
"outputs": [],
|
43
|
-
"source": [
|
44
|
-
"from tensorflow.keras.datasets import cifar10\n",
|
45
|
-
"from tensorflow.keras.utils import to_categorical\n",
|
46
|
-
"import tensorflow as tf\n",
|
47
|
-
"from tensorflow import keras\n",
|
48
|
-
"from tensorflow.keras import layers\n",
|
49
|
-
"import matplotlib.pyplot as plt"
|
50
|
-
]
|
51
|
-
},
|
52
|
-
{
|
53
|
-
"cell_type": "code",
|
54
|
-
"execution_count": null,
|
55
|
-
"metadata": {
|
56
|
-
"colab": {
|
57
|
-
"base_uri": "https://localhost:8080/"
|
58
|
-
},
|
59
|
-
"id": "dghWl91B66Ey",
|
60
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
61
|
-
},
|
62
|
-
"outputs": [],
|
63
|
-
"source": [
|
64
|
-
"(X_train, y_train), (X_test, y_test) = cifar10.load_data()"
|
65
|
-
]
|
66
|
-
},
|
67
|
-
{
|
68
|
-
"cell_type": "code",
|
69
|
-
"execution_count": null,
|
70
|
-
"metadata": {
|
71
|
-
"colab": {
|
72
|
-
"base_uri": "https://localhost:8080/"
|
73
|
-
},
|
74
|
-
"id": "dghWl91B66Ey",
|
75
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
76
|
-
},
|
77
|
-
"outputs": [],
|
78
|
-
"source": [
|
79
|
-
"def preprocess_data(X, y):\n",
|
80
|
-
" X = X.astype('float32') / 255.0 # Normalize to [0, 1]\n",
|
81
|
-
" y = to_categorical(y, num_classes=10) # One-hot encode labels\n",
|
82
|
-
" return X, y"
|
83
|
-
]
|
84
|
-
},
|
85
|
-
{
|
86
|
-
"cell_type": "code",
|
87
|
-
"execution_count": null,
|
88
|
-
"metadata": {
|
89
|
-
"colab": {
|
90
|
-
"base_uri": "https://localhost:8080/"
|
91
|
-
},
|
92
|
-
"id": "dghWl91B66Ey",
|
93
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
94
|
-
},
|
95
|
-
"outputs": [],
|
96
|
-
"source": [
|
97
|
-
" \n",
|
98
|
-
"x_train, y_train = preprocess_data(X_train, y_train)\n",
|
99
|
-
"x_test, y_test = preprocess_data(X_test, y_test)"
|
100
|
-
]
|
101
|
-
},
|
102
|
-
{
|
103
|
-
"cell_type": "code",
|
104
|
-
"execution_count": null,
|
105
|
-
"metadata": {
|
106
|
-
"colab": {
|
107
|
-
"base_uri": "https://localhost:8080/"
|
108
|
-
},
|
109
|
-
"id": "dghWl91B66Ey",
|
110
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
111
|
-
},
|
112
|
-
"outputs": [],
|
113
|
-
"source": [
|
114
|
-
"model = keras.Sequential(\n",
|
115
|
-
" [\n",
|
116
|
-
" keras.Input(shape=(32, 32, 3)),\n",
|
117
|
-
" layers.Conv2D(32, kernel_size=(3, 3), activation=\"relu\"),\n",
|
118
|
-
" layers.MaxPooling2D(pool_size=(2, 2)),\n",
|
119
|
-
" layers.Conv2D(64, kernel_size=(3, 3), activation=\"relu\"),\n",
|
120
|
-
" layers.MaxPooling2D(pool_size=(2, 2)),\n",
|
121
|
-
" layers.Flatten(),\n",
|
122
|
-
" layers.Dense(10, activation=\"softmax\"),\n",
|
123
|
-
" ]\n",
|
124
|
-
")"
|
125
|
-
]
|
126
|
-
},
|
127
|
-
{
|
128
|
-
"cell_type": "code",
|
129
|
-
"execution_count": null,
|
130
|
-
"metadata": {
|
131
|
-
"colab": {
|
132
|
-
"base_uri": "https://localhost:8080/"
|
133
|
-
},
|
134
|
-
"id": "dghWl91B66Ey",
|
135
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
136
|
-
},
|
137
|
-
"outputs": [],
|
138
|
-
"source": [
|
139
|
-
"model.compile(loss=\"categorical_crossentropy\", optimizer=\"adam\", metrics=[\"accuracy\"])"
|
140
|
-
]
|
141
|
-
},
|
142
|
-
{
|
143
|
-
"cell_type": "code",
|
144
|
-
"execution_count": null,
|
145
|
-
"metadata": {
|
146
|
-
"colab": {
|
147
|
-
"base_uri": "https://localhost:8080/"
|
148
|
-
},
|
149
|
-
"id": "dghWl91B66Ey",
|
150
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
151
|
-
},
|
152
|
-
"outputs": [],
|
153
|
-
"source": [
|
154
|
-
"early_stopping = tf.keras.callbacks.EarlyStopping(\n",
|
155
|
-
" monitor='val_loss',\n",
|
156
|
-
" patience=10,\n",
|
157
|
-
" restore_best_weights=True)"
|
158
|
-
]
|
159
|
-
},
|
160
|
-
{
|
161
|
-
"cell_type": "code",
|
162
|
-
"execution_count": null,
|
163
|
-
"metadata": {
|
164
|
-
"colab": {
|
165
|
-
"base_uri": "https://localhost:8080/"
|
166
|
-
},
|
167
|
-
"id": "dghWl91B66Ey",
|
168
|
-
"outputId": "a14fb7c3-44a7-4d93-805e-708ecc2157ef"
|
169
|
-
},
|
170
|
-
"outputs": [],
|
171
|
-
"source": [
|
172
|
-
"history = model.fit(x_train, y_train,\n",
|
173
|
-
" epochs=5,\n",
|
174
|
-
" batch_size=32,\n",
|
175
|
-
" validation_split=0.2,\n",
|
176
|
-
" callbacks=[early_stopping],\n",
|
177
|
-
" verbose=1)"
|
178
|
-
]
|
179
|
-
},
|
180
|
-
{
|
181
|
-
"cell_type": "code",
|
182
|
-
"execution_count": null,
|
183
|
-
"metadata": {
|
184
|
-
"colab": {
|
185
|
-
"base_uri": "https://localhost:8080/",
|
186
|
-
"height": 489
|
187
|
-
},
|
188
|
-
"id": "mU4ISHnR7BIW",
|
189
|
-
"outputId": "cbda13b8-4a96-4178-9ee4-f70e07d1bc64"
|
190
|
-
},
|
191
|
-
"outputs": [],
|
192
|
-
"source": [
|
193
|
-
"from sklearn.preprocessing import label_binarize\n",
|
194
|
-
"\n",
|
195
|
-
"y_test_bin = label_binarize(y_test, classes=list(range(10)))\n",
|
196
|
-
"y_pred_proba = model.predict(x_test)\n",
|
197
|
-
"\n",
|
198
|
-
"fpr, tpr, _ = roc_curve(y_test_bin[:, 0], y_pred_proba[:, 0])\n",
|
199
|
-
"roc_auc = auc(fpr, tpr)\n",
|
200
|
-
"\n",
|
201
|
-
"plt.figure()\n",
|
202
|
-
"plt.plot(fpr, tpr, color='darkorange', lw=2, label='Class 0 ROC curve (area = %0.2f)' % roc_auc)\n",
|
203
|
-
"plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--')\n",
|
204
|
-
"plt.xlim([0.0, 1.0])\n",
|
205
|
-
"plt.ylim([0.0, 1.05])\n",
|
206
|
-
"plt.xlabel('False Positive Rate')\n",
|
207
|
-
"plt.ylabel('True Positive Rate')\n",
|
208
|
-
"plt.title('ROC Curve for Class 0')\n",
|
209
|
-
"plt.legend(loc=\"lower right\")\n",
|
210
|
-
"plt.show()"
|
211
|
-
]
|
212
|
-
}
|
213
|
-
],
|
214
|
-
"metadata": {
|
215
|
-
"colab": {
|
216
|
-
"provenance": []
|
217
|
-
},
|
218
|
-
"kernelspec": {
|
219
|
-
"display_name": "Python 3 (ipykernel)",
|
220
|
-
"language": "python",
|
221
|
-
"name": "python3"
|
222
|
-
},
|
223
|
-
"language_info": {
|
224
|
-
"codemirror_mode": {
|
225
|
-
"name": "ipython",
|
226
|
-
"version": 3
|
227
|
-
},
|
228
|
-
"file_extension": ".py",
|
229
|
-
"mimetype": "text/x-python",
|
230
|
-
"name": "python",
|
231
|
-
"nbconvert_exporter": "python",
|
232
|
-
"pygments_lexer": "ipython3",
|
233
|
-
"version": "3.12.4"
|
234
|
-
}
|
235
|
-
},
|
236
|
-
"nbformat": 4,
|
237
|
-
"nbformat_minor": 4
|
238
|
-
}
|