noshot 6.0.0__tar.gz → 8.0.0__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 (71) hide show
  1. {noshot-6.0.0 → noshot-8.0.0}/PKG-INFO +1 -1
  2. {noshot-6.0.0 → noshot-8.0.0}/noshot.egg-info/PKG-INFO +1 -1
  3. noshot-8.0.0/noshot.egg-info/SOURCES.txt +63 -0
  4. {noshot-6.0.0 → noshot-8.0.0}/setup.py +1 -1
  5. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/CNN(Image_for_Folders_5).ipynb +201 -0
  6. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/CNN(Image_form_Folder_2).ipynb +201 -0
  7. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Balance Scale Dataset).ipynb +147 -0
  8. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Rice Dataset).ipynb +181 -0
  9. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/10. HMM Veterbi.ipynb +152 -0
  10. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Balance Scale Dataset).ipynb +117 -0
  11. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Iris Dataset).ipynb +156 -0
  12. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Sobar-72 Dataset).ipynb +215 -0
  13. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/3. LDA (Balance Scale Dataset).ipynb +78 -0
  14. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/3. LDA (NPHA Doctor Visits Dataset).ipynb +114 -0
  15. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Machine Dataset).ipynb +115 -0
  16. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Real Estate Dataset).ipynb +146 -0
  17. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Magic04 Dataset).ipynb +130 -0
  18. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Wine Dataset).ipynb +112 -0
  19. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Agaricus Lepiota Dataset).ipynb +118 -0
  20. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Wine Dataset).ipynb +89 -0
  21. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/7. SVM (Rice Dataset).ipynb +120 -0
  22. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/8. FeedForward NN (Sobar72 Dataset).ipynb +262 -0
  23. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 1/9. CNN (Cifar10 Dataset).ipynb +156 -0
  24. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/1. PCA.ipynb +162 -0
  25. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/10. CNN.ipynb +100 -0
  26. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/11. HMM.ipynb +336 -0
  27. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/2. KNN.ipynb +149 -0
  28. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/3. LDA.ipynb +132 -0
  29. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/4. Linear Regression.ipynb +86 -0
  30. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/5. Logistic Regression.ipynb +115 -0
  31. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Titanic).ipynb +196 -0
  32. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Wine).ipynb +98 -0
  33. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/7. SVM Linear.ipynb +109 -0
  34. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/8. SVM Non-Linear.ipynb +195 -0
  35. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/9. FNN With Regularization.ipynb +189 -0
  36. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/9. FNN Without Regularization.ipynb +197 -0
  37. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 2/All in One Lab CIA 1 Q.ipynb +1087 -0
  38. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/1. PCA EDA.ipynb +274 -0
  39. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/10. CNN.ipynb +170 -0
  40. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 2.ipynb +1087 -0
  41. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 3.ipynb +178 -0
  42. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 4.ipynb +185 -0
  43. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM.ipynb +106 -0
  44. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/2. KNN.ipynb +177 -0
  45. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/3. LDA.ipynb +195 -0
  46. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/4. Linear Regression.ipynb +267 -0
  47. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/5. Logistic Regression.ipynb +104 -0
  48. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/6. Bayesian Classifier.ipynb +109 -0
  49. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/7. SVM.ipynb +220 -0
  50. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/8. MLP.ipynb +99 -0
  51. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge - Lasso.ipynb +211 -0
  52. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge Lasso 2.ipynb +99 -0
  53. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/Image Load Example.ipynb +118 -0
  54. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/Updated_Untitled.ipynb +603 -0
  55. noshot-8.0.0/src/noshot/data/ML TS XAI/ML/Rolls Royce AllinOne.ipynb +691 -0
  56. noshot-6.0.0/noshot.egg-info/SOURCES.txt +0 -17
  57. noshot-6.0.0/src/noshot/data/ML TS XAI/XAI/Q1.ipynb +0 -377
  58. noshot-6.0.0/src/noshot/data/ML TS XAI/XAI/Q2.ipynb +0 -362
  59. noshot-6.0.0/src/noshot/data/ML TS XAI/XAI/Q3.ipynb +0 -637
  60. noshot-6.0.0/src/noshot/data/ML TS XAI/XAI/Q4.ipynb +0 -206
  61. noshot-6.0.0/src/noshot/data/ML TS XAI/XAI/Q5.ipynb +0 -1018
  62. {noshot-6.0.0 → noshot-8.0.0}/LICENSE.txt +0 -0
  63. {noshot-6.0.0 → noshot-8.0.0}/README.md +0 -0
  64. {noshot-6.0.0 → noshot-8.0.0}/noshot.egg-info/dependency_links.txt +0 -0
  65. {noshot-6.0.0 → noshot-8.0.0}/noshot.egg-info/not-zip-safe +0 -0
  66. {noshot-6.0.0 → noshot-8.0.0}/noshot.egg-info/top_level.txt +0 -0
  67. {noshot-6.0.0 → noshot-8.0.0}/setup.cfg +0 -0
  68. {noshot-6.0.0 → noshot-8.0.0}/src/noshot/__init__.py +0 -0
  69. {noshot-6.0.0 → noshot-8.0.0}/src/noshot/main.py +0 -0
  70. {noshot-6.0.0 → noshot-8.0.0}/src/noshot/utils/__init__.py +0 -0
  71. {noshot-6.0.0 → noshot-8.0.0}/src/noshot/utils/shell_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: noshot
3
- Version: 6.0.0
3
+ Version: 8.0.0
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: noshot
3
- Version: 6.0.0
3
+ Version: 8.0.0
4
4
  Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
5
  Author: Tim Stan S
6
6
  License: MIT
@@ -0,0 +1,63 @@
1
+ LICENSE.txt
2
+ README.md
3
+ setup.py
4
+ noshot.egg-info/PKG-INFO
5
+ noshot.egg-info/SOURCES.txt
6
+ noshot.egg-info/dependency_links.txt
7
+ noshot.egg-info/not-zip-safe
8
+ noshot.egg-info/top_level.txt
9
+ src/noshot/__init__.py
10
+ src/noshot/main.py
11
+ src/noshot/data/ML TS XAI/ML/CNN(Image_for_Folders_5).ipynb
12
+ src/noshot/data/ML TS XAI/ML/CNN(Image_form_Folder_2).ipynb
13
+ src/noshot/data/ML TS XAI/ML/Rolls Royce AllinOne.ipynb
14
+ src/noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Balance Scale Dataset).ipynb
15
+ src/noshot/data/ML TS XAI/ML/ML 1/1. EDA-PCA (Rice Dataset).ipynb
16
+ src/noshot/data/ML TS XAI/ML/ML 1/10. HMM Veterbi.ipynb
17
+ src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Balance Scale Dataset).ipynb
18
+ src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Iris Dataset).ipynb
19
+ src/noshot/data/ML TS XAI/ML/ML 1/2. KNN (Sobar-72 Dataset).ipynb
20
+ src/noshot/data/ML TS XAI/ML/ML 1/3. LDA (Balance Scale Dataset).ipynb
21
+ src/noshot/data/ML TS XAI/ML/ML 1/3. LDA (NPHA Doctor Visits Dataset).ipynb
22
+ src/noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Machine Dataset).ipynb
23
+ src/noshot/data/ML TS XAI/ML/ML 1/4. Linear Regression (Real Estate Dataset).ipynb
24
+ src/noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Magic04 Dataset).ipynb
25
+ src/noshot/data/ML TS XAI/ML/ML 1/5. Logistic Regression (Wine Dataset).ipynb
26
+ src/noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Agaricus Lepiota Dataset).ipynb
27
+ src/noshot/data/ML TS XAI/ML/ML 1/6. Naive Bayes Classifier (Wine Dataset).ipynb
28
+ src/noshot/data/ML TS XAI/ML/ML 1/7. SVM (Rice Dataset).ipynb
29
+ src/noshot/data/ML TS XAI/ML/ML 1/8. FeedForward NN (Sobar72 Dataset).ipynb
30
+ src/noshot/data/ML TS XAI/ML/ML 1/9. CNN (Cifar10 Dataset).ipynb
31
+ src/noshot/data/ML TS XAI/ML/ML 2/1. PCA.ipynb
32
+ src/noshot/data/ML TS XAI/ML/ML 2/10. CNN.ipynb
33
+ src/noshot/data/ML TS XAI/ML/ML 2/11. HMM.ipynb
34
+ src/noshot/data/ML TS XAI/ML/ML 2/2. KNN.ipynb
35
+ src/noshot/data/ML TS XAI/ML/ML 2/3. LDA.ipynb
36
+ src/noshot/data/ML TS XAI/ML/ML 2/4. Linear Regression.ipynb
37
+ src/noshot/data/ML TS XAI/ML/ML 2/5. Logistic Regression.ipynb
38
+ src/noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Titanic).ipynb
39
+ src/noshot/data/ML TS XAI/ML/ML 2/6. Naive Bayes (Wine).ipynb
40
+ src/noshot/data/ML TS XAI/ML/ML 2/7. SVM Linear.ipynb
41
+ src/noshot/data/ML TS XAI/ML/ML 2/8. SVM Non-Linear.ipynb
42
+ src/noshot/data/ML TS XAI/ML/ML 2/9. FNN With Regularization.ipynb
43
+ src/noshot/data/ML TS XAI/ML/ML 2/9. FNN Without Regularization.ipynb
44
+ src/noshot/data/ML TS XAI/ML/ML 2/All in One Lab CIA 1 Q.ipynb
45
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/1. PCA EDA.ipynb
46
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/10. CNN.ipynb
47
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 2.ipynb
48
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 3.ipynb
49
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM 4.ipynb
50
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/11. HMM.ipynb
51
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/2. KNN.ipynb
52
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/3. LDA.ipynb
53
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/4. Linear Regression.ipynb
54
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/5. Logistic Regression.ipynb
55
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/6. Bayesian Classifier.ipynb
56
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/7. SVM.ipynb
57
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/8. MLP.ipynb
58
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge - Lasso.ipynb
59
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/9. Ridge Lasso 2.ipynb
60
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/Image Load Example.ipynb
61
+ src/noshot/data/ML TS XAI/ML/ML 3 (Latest)/Updated_Untitled.ipynb
62
+ src/noshot/utils/__init__.py
63
+ src/noshot/utils/shell_utils.py
@@ -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="6.0.0",
8
+ version="8.0.0",
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,
@@ -0,0 +1,201 @@
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ }
15
+ },
16
+ "cells": [
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": 3,
20
+ "metadata": {
21
+ "colab": {
22
+ "base_uri": "https://localhost:8080/"
23
+ },
24
+ "id": "BlWncmICrVwe",
25
+ "outputId": "a7219871-550c-456a-c487-f3a4cfcd4564"
26
+ },
27
+ "outputs": [
28
+ {
29
+ "output_type": "stream",
30
+ "name": "stdout",
31
+ "text": [
32
+ "Found 125 files belonging to 5 classes.\n",
33
+ "Using 100 files for training.\n",
34
+ "Found 125 files belonging to 5 classes.\n",
35
+ "Using 25 files for validation.\n",
36
+ "Epoch 1/10\n"
37
+ ]
38
+ },
39
+ {
40
+ "output_type": "stream",
41
+ "name": "stderr",
42
+ "text": [
43
+ "/usr/local/lib/python3.11/dist-packages/keras/src/layers/preprocessing/tf_data_layer.py:19: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
44
+ " super().__init__(**kwargs)\n"
45
+ ]
46
+ },
47
+ {
48
+ "output_type": "stream",
49
+ "name": "stdout",
50
+ "text": [
51
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 0.5803 - loss: 1.1232 - val_accuracy: 1.0000 - val_loss: 0.0053\n",
52
+ "Epoch 2/10\n",
53
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 0.0041 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
54
+ "Epoch 3/10\n",
55
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 1.8428e-09 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
56
+ "Epoch 4/10\n",
57
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m7s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 0.0000e+00 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
58
+ "Epoch 5/10\n",
59
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m20s\u001b[0m 4s/step - accuracy: 1.0000 - loss: 0.0000e+00 - val_accuracy: 1.0000 - val_loss: 3.3379e-08\n",
60
+ "Epoch 6/10\n",
61
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m12s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 6.8267e-08 - val_accuracy: 1.0000 - val_loss: 2.5913e-05\n",
62
+ "Epoch 7/10\n",
63
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 2.7628e-05 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
64
+ "Epoch 8/10\n",
65
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 0.0000e+00 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
66
+ "Epoch 9/10\n",
67
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m12s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 0.0000e+00 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n",
68
+ "Epoch 10/10\n",
69
+ "\u001b[1m4/4\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 2s/step - accuracy: 1.0000 - loss: 0.0000e+00 - val_accuracy: 1.0000 - val_loss: 0.0000e+00\n"
70
+ ]
71
+ },
72
+ {
73
+ "output_type": "stream",
74
+ "name": "stderr",
75
+ "text": [
76
+ "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n"
77
+ ]
78
+ }
79
+ ],
80
+ "source": [
81
+ "import tensorflow as tf\n",
82
+ "from tensorflow.keras import layers, models\n",
83
+ "import os\n",
84
+ "\n",
85
+ "dataset_path = '/content/Dataset'\n",
86
+ "\n",
87
+ "img_height, img_width = 180, 180\n",
88
+ "batch_size = 32\n",
89
+ "\n",
90
+ "train_ds = tf.keras.utils.image_dataset_from_directory(\n",
91
+ " dataset_path,\n",
92
+ " validation_split=0.2,\n",
93
+ " subset=\"training\",\n",
94
+ " seed=123,\n",
95
+ " image_size=(img_height, img_width),\n",
96
+ " batch_size=batch_size)\n",
97
+ "\n",
98
+ "val_ds = tf.keras.utils.image_dataset_from_directory(\n",
99
+ " dataset_path,\n",
100
+ " validation_split=0.2,\n",
101
+ " subset=\"validation\",\n",
102
+ " seed=123,\n",
103
+ " image_size=(img_height, img_width),\n",
104
+ " batch_size=batch_size)\n",
105
+ "\n",
106
+ "model = models.Sequential([\n",
107
+ " layers.Rescaling(1./255, input_shape=(img_height, img_width, 3)),\n",
108
+ " layers.Conv2D(32, 3, activation='relu'),\n",
109
+ " layers.MaxPooling2D(),\n",
110
+ " layers.Conv2D(64, 3, activation='relu'),\n",
111
+ " layers.MaxPooling2D(),\n",
112
+ " layers.Conv2D(128, 3, activation='relu'),\n",
113
+ " layers.MaxPooling2D(),\n",
114
+ " layers.Flatten(),\n",
115
+ " layers.Dense(128, activation='relu'),\n",
116
+ " layers.Dense(5)\n",
117
+ "])\n",
118
+ "\n",
119
+ "model.compile(optimizer='adam',\n",
120
+ " loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
121
+ " metrics=['accuracy'])\n",
122
+ "\n",
123
+ "epochs = 10\n",
124
+ "history = model.fit(\n",
125
+ " train_ds,\n",
126
+ " validation_data=val_ds,\n",
127
+ " epochs=epochs\n",
128
+ ")\n",
129
+ "\n",
130
+ "model.save('pistachio_classifier.h5')\n"
131
+ ]
132
+ },
133
+ {
134
+ "cell_type": "code",
135
+ "source": [
136
+ "import tensorflow as tf\n",
137
+ "import numpy as np\n",
138
+ "from tensorflow.keras.preprocessing import image\n",
139
+ "\n",
140
+ "model = tf.keras.models.load_model('pistachio_classifier.h5')\n",
141
+ "\n",
142
+ "class_names = ['1','2','3','A','B']\n"
143
+ ],
144
+ "metadata": {
145
+ "colab": {
146
+ "base_uri": "https://localhost:8080/"
147
+ },
148
+ "id": "5V8OLPNKsQSq",
149
+ "outputId": "9b62fcc7-fca4-4ee0-8e9e-66b4538d7771"
150
+ },
151
+ "execution_count": 4,
152
+ "outputs": [
153
+ {
154
+ "output_type": "stream",
155
+ "name": "stderr",
156
+ "text": [
157
+ "WARNING:absl:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
158
+ ]
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "cell_type": "code",
164
+ "source": [
165
+ "\n",
166
+ "img_path = '/content/2.jpg'\n",
167
+ "\n",
168
+ "\n",
169
+ "img = image.load_img(img_path, target_size=(180, 180))\n",
170
+ "img_array = image.img_to_array(img)\n",
171
+ "img_array = tf.expand_dims(img_array, 0)\n",
172
+ "\n",
173
+ "predictions = model.predict(img_array)\n",
174
+ "score = tf.nn.softmax(predictions[0])\n",
175
+ "\n",
176
+ "predicted_class = class_names[np.argmax(score)]\n",
177
+ "confidence = 100 * np.max(score)\n",
178
+ "\n",
179
+ "print(f\"This image most likely belongs to '{predicted_class}' with a {confidence:.2f}% confidence.\")\n"
180
+ ],
181
+ "metadata": {
182
+ "colab": {
183
+ "base_uri": "https://localhost:8080/"
184
+ },
185
+ "id": "Cn_opNultOiQ",
186
+ "outputId": "ed80fd91-4da5-444a-8925-8509b1991727"
187
+ },
188
+ "execution_count": 5,
189
+ "outputs": [
190
+ {
191
+ "output_type": "stream",
192
+ "name": "stdout",
193
+ "text": [
194
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 151ms/step\n",
195
+ "This image most likely belongs to '2' with a 100.00% confidence.\n"
196
+ ]
197
+ }
198
+ ]
199
+ }
200
+ ]
201
+ }
@@ -0,0 +1,201 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "source": [
6
+ "import tensorflow as tf\n",
7
+ "from tensorflow.keras import layers, models\n",
8
+ "import os\n",
9
+ "\n",
10
+ "dataset_path = '/content/Dataset'\n",
11
+ "\n",
12
+ "img_height, img_width = 180, 180\n",
13
+ "batch_size = 32\n",
14
+ "\n",
15
+ "train_ds = tf.keras.utils.image_dataset_from_directory(\n",
16
+ " dataset_path,\n",
17
+ " validation_split=0.2,\n",
18
+ " subset=\"training\",\n",
19
+ " seed=123,\n",
20
+ " image_size=(img_height, img_width),\n",
21
+ " batch_size=batch_size)\n",
22
+ "\n",
23
+ "val_ds = tf.keras.utils.image_dataset_from_directory(\n",
24
+ " dataset_path,\n",
25
+ " validation_split=0.2,\n",
26
+ " subset=\"validation\",\n",
27
+ " seed=123,\n",
28
+ " image_size=(img_height, img_width),\n",
29
+ " batch_size=batch_size)\n",
30
+ "\n",
31
+ "model = models.Sequential([\n",
32
+ " layers.Rescaling(1./255, input_shape=(img_height, img_width, 3)),\n",
33
+ " layers.Conv2D(32, 3, activation='relu'),\n",
34
+ " layers.MaxPooling2D(),\n",
35
+ " layers.Conv2D(64, 3, activation='relu'),\n",
36
+ " layers.MaxPooling2D(),\n",
37
+ " layers.Conv2D(128, 3, activation='relu'),\n",
38
+ " layers.MaxPooling2D(),\n",
39
+ " layers.Flatten(),\n",
40
+ " layers.Dense(128, activation='relu'),\n",
41
+ " layers.Dense(2)\n",
42
+ "])\n",
43
+ "\n",
44
+ "model.compile(optimizer='adam',\n",
45
+ " loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),\n",
46
+ " metrics=['accuracy'])\n",
47
+ "\n",
48
+ "epochs = 10\n",
49
+ "history = model.fit(\n",
50
+ " train_ds,\n",
51
+ " validation_data=val_ds,\n",
52
+ " epochs=epochs\n",
53
+ ")\n",
54
+ "\n",
55
+ "model.save('pistachio_classifier.h5')\n"
56
+ ],
57
+ "metadata": {
58
+ "colab": {
59
+ "base_uri": "https://localhost:8080/"
60
+ },
61
+ "id": "X5rygqUYn0NL",
62
+ "outputId": "dfb18a11-ecb5-4221-c838-f2b0af4c87c3"
63
+ },
64
+ "execution_count": 1,
65
+ "outputs": [
66
+ {
67
+ "output_type": "stream",
68
+ "name": "stdout",
69
+ "text": [
70
+ "Found 100 files belonging to 2 classes.\n",
71
+ "Using 80 files for training.\n",
72
+ "Found 100 files belonging to 2 classes.\n",
73
+ "Using 20 files for validation.\n"
74
+ ]
75
+ },
76
+ {
77
+ "output_type": "stream",
78
+ "name": "stderr",
79
+ "text": [
80
+ "/usr/local/lib/python3.11/dist-packages/keras/src/layers/preprocessing/tf_data_layer.py:19: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
81
+ " super().__init__(**kwargs)\n"
82
+ ]
83
+ },
84
+ {
85
+ "output_type": "stream",
86
+ "name": "stdout",
87
+ "text": [
88
+ "Epoch 1/10\n",
89
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 0.5469 - loss: 0.7486 - val_accuracy: 0.6000 - val_loss: 0.8673\n",
90
+ "Epoch 2/10\n",
91
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 2s/step - accuracy: 0.5352 - loss: 0.7847 - val_accuracy: 0.6500 - val_loss: 0.6347\n",
92
+ "Epoch 3/10\n",
93
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 1s/step - accuracy: 0.8211 - loss: 0.4471 - val_accuracy: 0.8000 - val_loss: 0.6110\n",
94
+ "Epoch 4/10\n",
95
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m6s\u001b[0m 2s/step - accuracy: 0.8797 - loss: 0.3727 - val_accuracy: 0.8500 - val_loss: 0.8057\n",
96
+ "Epoch 5/10\n",
97
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m6s\u001b[0m 2s/step - accuracy: 0.8742 - loss: 0.3163 - val_accuracy: 0.6500 - val_loss: 0.9343\n",
98
+ "Epoch 6/10\n",
99
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 0.8070 - loss: 0.3726 - val_accuracy: 0.8000 - val_loss: 0.7291\n",
100
+ "Epoch 7/10\n",
101
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 1s/step - accuracy: 0.8766 - loss: 0.2542 - val_accuracy: 0.8000 - val_loss: 0.6933\n",
102
+ "Epoch 8/10\n",
103
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m6s\u001b[0m 2s/step - accuracy: 0.9453 - loss: 0.1739 - val_accuracy: 0.8500 - val_loss: 0.6692\n",
104
+ "Epoch 9/10\n",
105
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 0.8969 - loss: 0.1860 - val_accuracy: 0.8500 - val_loss: 0.7117\n",
106
+ "Epoch 10/10\n",
107
+ "\u001b[1m3/3\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m10s\u001b[0m 2s/step - accuracy: 0.9250 - loss: 0.1766 - val_accuracy: 0.8500 - val_loss: 0.7313\n"
108
+ ]
109
+ },
110
+ {
111
+ "output_type": "stream",
112
+ "name": "stderr",
113
+ "text": [
114
+ "WARNING:absl:You are saving your model as an HDF5 file via `model.save()` or `keras.saving.save_model(model)`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')` or `keras.saving.save_model(model, 'my_model.keras')`. \n"
115
+ ]
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "cell_type": "code",
121
+ "source": [
122
+ "import tensorflow as tf\n",
123
+ "import numpy as np\n",
124
+ "from tensorflow.keras.preprocessing import image\n",
125
+ "\n",
126
+ "model = tf.keras.models.load_model('pistachio_classifier.h5')\n",
127
+ "\n",
128
+ "class_names = ['Kirmizi_Pistachio', 'Siirt_Pistachio']\n"
129
+ ],
130
+ "metadata": {
131
+ "colab": {
132
+ "base_uri": "https://localhost:8080/"
133
+ },
134
+ "id": "7GyugRDLpLlN",
135
+ "outputId": "8bad83c9-c088-405a-ec06-ac493f6d7072"
136
+ },
137
+ "execution_count": 2,
138
+ "outputs": [
139
+ {
140
+ "output_type": "stream",
141
+ "name": "stderr",
142
+ "text": [
143
+ "WARNING:absl:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
144
+ ]
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ "cell_type": "code",
150
+ "source": [
151
+ "\n",
152
+ "img_path = '/content/siirt (3).jpg'\n",
153
+ "\n",
154
+ "\n",
155
+ "img = image.load_img(img_path, target_size=(180, 180))\n",
156
+ "img_array = image.img_to_array(img)\n",
157
+ "img_array = tf.expand_dims(img_array, 0)\n",
158
+ "\n",
159
+ "predictions = model.predict(img_array)\n",
160
+ "score = tf.nn.softmax(predictions[0])\n",
161
+ "\n",
162
+ "predicted_class = class_names[np.argmax(score)]\n",
163
+ "confidence = 100 * np.max(score)\n",
164
+ "\n",
165
+ "print(f\"This image most likely belongs to '{predicted_class}' with a {confidence:.2f}% confidence.\")\n"
166
+ ],
167
+ "metadata": {
168
+ "colab": {
169
+ "base_uri": "https://localhost:8080/"
170
+ },
171
+ "id": "SwZcLQftpOYI",
172
+ "outputId": "90c61acd-31cd-4c49-97f8-59bc90fc029c"
173
+ },
174
+ "execution_count": 3,
175
+ "outputs": [
176
+ {
177
+ "output_type": "stream",
178
+ "name": "stdout",
179
+ "text": [
180
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 188ms/step\n",
181
+ "This image most likely belongs to 'Kirmizi_Pistachio' with a 94.41% confidence.\n"
182
+ ]
183
+ }
184
+ ]
185
+ }
186
+ ],
187
+ "metadata": {
188
+ "colab": {
189
+ "provenance": []
190
+ },
191
+ "kernelspec": {
192
+ "display_name": "Python 3",
193
+ "name": "python3"
194
+ },
195
+ "language_info": {
196
+ "name": "python"
197
+ }
198
+ },
199
+ "nbformat": 4,
200
+ "nbformat_minor": 0
201
+ }
@@ -0,0 +1,147 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "b96a1a1c-b14e-409e-ab95-075ba7b80df3",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import pandas as pd\n",
11
+ "import numpy as np\n",
12
+ "import seaborn as sns\n",
13
+ "import matplotlib.pyplot as plt\n",
14
+ "from sklearn.preprocessing import StandardScaler\n",
15
+ "from sklearn.decomposition import PCA\n",
16
+ "\n",
17
+ "import warnings\n",
18
+ "warnings.filterwarnings('ignore')"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": null,
24
+ "id": "a27b3cce-5a43-4443-a2c0-964a15d4d5fc",
25
+ "metadata": {},
26
+ "outputs": [],
27
+ "source": [
28
+ "cols = ['class name', 'left-weight', 'left-distance', 'right-weight', 'right-distance']\n",
29
+ "df = pd.read_table('data/balance-scale.txt', delimiter=',', names=cols)\n",
30
+ "print(\"Shape:\", df.shape)\n",
31
+ "df.head()"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "execution_count": null,
37
+ "id": "b9f866da-69f2-44d9-a628-431cdb81d41e",
38
+ "metadata": {},
39
+ "outputs": [],
40
+ "source": [
41
+ "df.describe()"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type": "code",
46
+ "execution_count": null,
47
+ "id": "f23c78cb-422f-492d-ab8c-00ba1ac8a4b2",
48
+ "metadata": {},
49
+ "outputs": [],
50
+ "source": [
51
+ "df.info()"
52
+ ]
53
+ },
54
+ {
55
+ "cell_type": "code",
56
+ "execution_count": null,
57
+ "id": "d2a5b059-df8f-4495-bee8-57031cce0a78",
58
+ "metadata": {},
59
+ "outputs": [],
60
+ "source": [
61
+ "sns.countplot(df, x='class name', hue='class name')\n",
62
+ "plt.title(\"Count Plot ['B', 'R', 'L']\")\n",
63
+ "plt.show()"
64
+ ]
65
+ },
66
+ {
67
+ "cell_type": "code",
68
+ "execution_count": null,
69
+ "id": "5da4b529-7f9f-4fa4-b251-7daf2a285c15",
70
+ "metadata": {},
71
+ "outputs": [],
72
+ "source": [
73
+ "features = ['left-weight', 'left-distance', 'right-weight', 'right-distance']\n",
74
+ "x = df.loc[:, features]\n",
75
+ "y = df.loc[:, 'class name']"
76
+ ]
77
+ },
78
+ {
79
+ "cell_type": "code",
80
+ "execution_count": null,
81
+ "id": "bacac77a-5b5f-480c-8e4d-8172980baea7",
82
+ "metadata": {},
83
+ "outputs": [],
84
+ "source": [
85
+ "x = StandardScaler().fit_transform(x)\n",
86
+ "pca = PCA(n_components=2)\n",
87
+ "pct = pca.fit_transform(x)"
88
+ ]
89
+ },
90
+ {
91
+ "cell_type": "code",
92
+ "execution_count": null,
93
+ "id": "ffdcdf85-56c8-4b02-bad8-05f9654805ef",
94
+ "metadata": {},
95
+ "outputs": [],
96
+ "source": [
97
+ "principal_df = pd.DataFrame(pct, columns=['pc1', 'pc2'])\n",
98
+ "principal_df['class name'] = df['class name']\n",
99
+ "principal_df.head()"
100
+ ]
101
+ },
102
+ {
103
+ "cell_type": "code",
104
+ "execution_count": null,
105
+ "id": "db3dae54-3134-4d41-998e-0cf46ae16714",
106
+ "metadata": {},
107
+ "outputs": [],
108
+ "source": [
109
+ "fig = plt.figure(figsize=(8,8))\n",
110
+ "ax = fig.add_subplot(1, 1, 1)\n",
111
+ "\n",
112
+ "targets = ['L','B','R']\n",
113
+ "colors = ['r', 'g','b']\n",
114
+ "for target, color in zip(targets, colors):\n",
115
+ " selected = principal_df[principal_df['class name'] == target]\n",
116
+ " ax.scatter(selected['pc1'], selected['pc2'], c=color, s=50)\n",
117
+ "\n",
118
+ "ax.set_xlabel('Principal Component 1')\n",
119
+ "ax.set_ylabel('Principal Component 2')\n",
120
+ "ax.set_title('2 component PCA')\n",
121
+ "ax.legend(targets)\n",
122
+ "ax.grid()"
123
+ ]
124
+ }
125
+ ],
126
+ "metadata": {
127
+ "kernelspec": {
128
+ "display_name": "Python 3 (ipykernel)",
129
+ "language": "python",
130
+ "name": "python3"
131
+ },
132
+ "language_info": {
133
+ "codemirror_mode": {
134
+ "name": "ipython",
135
+ "version": 3
136
+ },
137
+ "file_extension": ".py",
138
+ "mimetype": "text/x-python",
139
+ "name": "python",
140
+ "nbconvert_exporter": "python",
141
+ "pygments_lexer": "ipython3",
142
+ "version": "3.12.4"
143
+ }
144
+ },
145
+ "nbformat": 4,
146
+ "nbformat_minor": 5
147
+ }