noshot 0.3.1__py3-none-any.whl → 0.3.3__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/ML/1. PCA - EDA.ipynb +207 -0
- noshot/data/ML TS XAI/ML/2. KNN Classifier.ipynb +287 -0
- noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis.ipynb +83 -0
- noshot/data/ML TS XAI/ML/4. Linear Regression.ipynb +117 -0
- noshot/data/ML TS XAI/ML/5. Logistic Regression.ipynb +151 -0
- noshot/data/ML TS XAI/ML/6. Bayesian Classifier.ipynb +89 -0
- noshot/data/ML TS XAI/ML/data/balance-scale.csv +626 -0
- noshot/data/ML TS XAI/ML/data/balance-scale.txt +625 -0
- noshot/data/ML TS XAI/ML/data/machine-data.csv +210 -0
- noshot/data/ML TS XAI/ML/data/wine-dataset.csv +179 -0
- noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data.ipynb +247 -0
- noshot/data/ML TS XAI/TS/2. Feature Engineering.ipynb +183 -0
- noshot/data/ML TS XAI/TS/3. Temporal Relationships.ipynb +172 -0
- noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interpolation.ipynb +146 -0
- noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality.ipynb +173 -0
- noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation.ipynb +77 -0
- noshot/data/ML TS XAI/TS/AllinOne.ipynb +1416 -0
- noshot/data/ML TS XAI/TS/data/daily-min-temperatures.csv +3651 -0
- noshot/data/ML TS XAI/TS/data/daily-total-female-births.csv +366 -0
- noshot/data/ML TS XAI/TS/data/raw_sales.csv +29581 -0
- noshot/data/ML TS XAI/TS/data/shampoo_sales.csv +37 -0
- noshot/main.py +18 -18
- noshot/utils/__init__.py +2 -2
- noshot/utils/shell_utils.py +56 -56
- {noshot-0.3.1.dist-info → noshot-0.3.3.dist-info}/LICENSE.txt +20 -20
- {noshot-0.3.1.dist-info → noshot-0.3.3.dist-info}/METADATA +55 -55
- noshot-0.3.3.dist-info/RECORD +30 -0
- noshot-0.3.1.dist-info/RECORD +0 -9
- {noshot-0.3.1.dist-info → noshot-0.3.3.dist-info}/WHEEL +0 -0
- {noshot-0.3.1.dist-info → noshot-0.3.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,151 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "code",
|
5
|
+
"execution_count": null,
|
6
|
+
"id": "0fcc8bb7-4d22-4d3b-b58a-302bb24f8f2e",
|
7
|
+
"metadata": {},
|
8
|
+
"outputs": [],
|
9
|
+
"source": [
|
10
|
+
"import itertools\n",
|
11
|
+
"import numpy as np\n",
|
12
|
+
"import pandas as pd\n",
|
13
|
+
"import matplotlib.pyplot as plt\n",
|
14
|
+
"from sklearn import linear_model,datasets\n",
|
15
|
+
"from sklearn.model_selection import train_test_split\n",
|
16
|
+
"from sklearn.metrics import confusion_matrix\n",
|
17
|
+
"import warnings\n",
|
18
|
+
"warnings.filterwarnings('ignore')"
|
19
|
+
]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"cell_type": "code",
|
23
|
+
"execution_count": null,
|
24
|
+
"id": "d28e507b-fb15-4058-a161-656859a27c65",
|
25
|
+
"metadata": {},
|
26
|
+
"outputs": [],
|
27
|
+
"source": [
|
28
|
+
"wine = pd.read_csv('data/wine-dataset.csv')\n",
|
29
|
+
"print(wine.shape)"
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"cell_type": "code",
|
34
|
+
"execution_count": null,
|
35
|
+
"id": "c4e953da-6941-43f2-a9ce-aab907876d45",
|
36
|
+
"metadata": {},
|
37
|
+
"outputs": [],
|
38
|
+
"source": [
|
39
|
+
"wine.columns"
|
40
|
+
]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"cell_type": "code",
|
44
|
+
"execution_count": null,
|
45
|
+
"id": "9ee44a66-dc4a-4c79-9dab-eec60669dd8b",
|
46
|
+
"metadata": {},
|
47
|
+
"outputs": [],
|
48
|
+
"source": [
|
49
|
+
"X = wine.iloc[:, :13]\n",
|
50
|
+
"X.head()"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"cell_type": "code",
|
55
|
+
"execution_count": null,
|
56
|
+
"id": "5cfd2fe6-3825-4d95-b606-3b3e2ef685b2",
|
57
|
+
"metadata": {},
|
58
|
+
"outputs": [],
|
59
|
+
"source": [
|
60
|
+
"y = wine.iloc[:, 13]\n",
|
61
|
+
"y"
|
62
|
+
]
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"cell_type": "code",
|
66
|
+
"execution_count": null,
|
67
|
+
"id": "bd9d60dd-8272-46b4-8335-69d9751ed0c7",
|
68
|
+
"metadata": {},
|
69
|
+
"outputs": [],
|
70
|
+
"source": [
|
71
|
+
"X_train,X_test,y_train,y_test = train_test_split(X, y, test_size=0.30, random_state=7)\n",
|
72
|
+
"\n",
|
73
|
+
"log_reg_model = linear_model.LogisticRegression()\n",
|
74
|
+
"log_reg_model.fit(X_train,y_train)"
|
75
|
+
]
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"cell_type": "code",
|
79
|
+
"execution_count": null,
|
80
|
+
"id": "7c8fca42-c8d8-4334-9cc4-da4f5e1b0a1e",
|
81
|
+
"metadata": {},
|
82
|
+
"outputs": [],
|
83
|
+
"source": [
|
84
|
+
"log_reg_base_score = log_reg_model.score(X_test,y_test)\n",
|
85
|
+
"print(\"The score for the Logistic Regression Model is : \", log_reg_base_score)"
|
86
|
+
]
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"cell_type": "code",
|
90
|
+
"execution_count": null,
|
91
|
+
"id": "61bbb23e-cb29-41ae-9ea3-82e8d465c7f2",
|
92
|
+
"metadata": {},
|
93
|
+
"outputs": [],
|
94
|
+
"source": [
|
95
|
+
"cm = confusion_matrix(y_test, log_reg_model.predict(X_test))\n",
|
96
|
+
"print(cm)"
|
97
|
+
]
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"cell_type": "code",
|
101
|
+
"execution_count": null,
|
102
|
+
"id": "600ec8f2-34e1-4be7-8ef5-fe53ff673f41",
|
103
|
+
"metadata": {
|
104
|
+
"scrolled": true
|
105
|
+
},
|
106
|
+
"outputs": [],
|
107
|
+
"source": [
|
108
|
+
"X = X.iloc[:, :2]\n",
|
109
|
+
"Y = y\n",
|
110
|
+
"\n",
|
111
|
+
"log_reg_model.fit(X,Y)\n",
|
112
|
+
"x_min, x_max = X.iloc[:, 0].min() - .5, X.iloc[:, 0].max() + .5\n",
|
113
|
+
"y_min, y_max = X.iloc[:, 1].min() - .5, X.iloc[:, 1].max() + .5\n",
|
114
|
+
"xx, yy = np.meshgrid(np.arange(x_min, x_max, .01), np.arange(y_min, y_max, .01))\n",
|
115
|
+
"Z = log_reg_model.predict(np.c_[xx.ravel(), yy.ravel()])\n",
|
116
|
+
"Z = Z.reshape(xx.shape)\n",
|
117
|
+
"plt.figure(1, figsize = (4, 3))\n",
|
118
|
+
"plt.pcolormesh(xx, yy, Z, cmap = plt.cm.Paired)\n",
|
119
|
+
"plt.scatter(X.iloc[:, 0], X.iloc[:, 1], c = Y, edgecolors = 'k', cmap = plt.cm.Paired)\n",
|
120
|
+
"plt.xlabel('X')\n",
|
121
|
+
"plt.ylabel('Y')\n",
|
122
|
+
"plt.xlim(xx.min(), xx.max())\n",
|
123
|
+
"plt.ylim(yy.min(), yy.max())\n",
|
124
|
+
"plt.xticks(())\n",
|
125
|
+
"plt.yticks(())\n",
|
126
|
+
"plt.show()"
|
127
|
+
]
|
128
|
+
}
|
129
|
+
],
|
130
|
+
"metadata": {
|
131
|
+
"kernelspec": {
|
132
|
+
"display_name": "Python 3 (ipykernel)",
|
133
|
+
"language": "python",
|
134
|
+
"name": "python3"
|
135
|
+
},
|
136
|
+
"language_info": {
|
137
|
+
"codemirror_mode": {
|
138
|
+
"name": "ipython",
|
139
|
+
"version": 3
|
140
|
+
},
|
141
|
+
"file_extension": ".py",
|
142
|
+
"mimetype": "text/x-python",
|
143
|
+
"name": "python",
|
144
|
+
"nbconvert_exporter": "python",
|
145
|
+
"pygments_lexer": "ipython3",
|
146
|
+
"version": "3.12.4"
|
147
|
+
}
|
148
|
+
},
|
149
|
+
"nbformat": 4,
|
150
|
+
"nbformat_minor": 5
|
151
|
+
}
|
@@ -0,0 +1,89 @@
|
|
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\n",
|
14
|
+
"import pandas as pd"
|
15
|
+
]
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"cell_type": "code",
|
19
|
+
"execution_count": null,
|
20
|
+
"id": "17720a0d-e788-4b1d-b2b2-a542f6b824a2",
|
21
|
+
"metadata": {},
|
22
|
+
"outputs": [],
|
23
|
+
"source": [
|
24
|
+
"wine = pd.read_csv('data/wine-dataset.csv')\n",
|
25
|
+
"print(wine.shape)"
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"cell_type": "code",
|
30
|
+
"execution_count": null,
|
31
|
+
"id": "a050923e-4382-4ff7-93bf-446b117c0ef5",
|
32
|
+
"metadata": {},
|
33
|
+
"outputs": [],
|
34
|
+
"source": [
|
35
|
+
"X = wine.iloc[:, :13]\n",
|
36
|
+
"X.head()"
|
37
|
+
]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"cell_type": "code",
|
41
|
+
"execution_count": null,
|
42
|
+
"id": "9f1a4355-718e-40ed-b892-3e3d03c4ef3c",
|
43
|
+
"metadata": {},
|
44
|
+
"outputs": [],
|
45
|
+
"source": [
|
46
|
+
"y = wine.iloc[:, 13]\n",
|
47
|
+
"y"
|
48
|
+
]
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"cell_type": "code",
|
52
|
+
"execution_count": null,
|
53
|
+
"id": "dd3f31ef-c0d2-48dd-9fb7-338c10f9fbf9",
|
54
|
+
"metadata": {},
|
55
|
+
"outputs": [],
|
56
|
+
"source": [
|
57
|
+
"X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 0)\n",
|
58
|
+
"\n",
|
59
|
+
"gnb = GaussianNB().fit(X_train, y_train)\n",
|
60
|
+
"gnb_predictions = gnb.predict(X_test)\n",
|
61
|
+
"accuracy = gnb.score(X_test, y_test)\n",
|
62
|
+
"accuracy\n",
|
63
|
+
"cm = confusion_matrix(y_test, gnb_predictions)\n",
|
64
|
+
"cm"
|
65
|
+
]
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"metadata": {
|
69
|
+
"kernelspec": {
|
70
|
+
"display_name": "Python 3 (ipykernel)",
|
71
|
+
"language": "python",
|
72
|
+
"name": "python3"
|
73
|
+
},
|
74
|
+
"language_info": {
|
75
|
+
"codemirror_mode": {
|
76
|
+
"name": "ipython",
|
77
|
+
"version": 3
|
78
|
+
},
|
79
|
+
"file_extension": ".py",
|
80
|
+
"mimetype": "text/x-python",
|
81
|
+
"name": "python",
|
82
|
+
"nbconvert_exporter": "python",
|
83
|
+
"pygments_lexer": "ipython3",
|
84
|
+
"version": "3.12.4"
|
85
|
+
}
|
86
|
+
},
|
87
|
+
"nbformat": 4,
|
88
|
+
"nbformat_minor": 5
|
89
|
+
}
|