noshot 0.3.9__py3-none-any.whl → 0.4.1__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 (68) hide show
  1. noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb +928 -0
  2. noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb +1270 -0
  3. noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb +175 -0
  4. noshot/data/ML TS XAI/TS/7. Differencing.ipynb +303 -0
  5. noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb +746 -0
  6. noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb +579 -0
  7. noshot/main.py +18 -18
  8. noshot/utils/__init__.py +2 -2
  9. noshot/utils/shell_utils.py +56 -56
  10. {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/METADATA +58 -55
  11. noshot-0.4.1.dist-info/RECORD +15 -0
  12. {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/WHEEL +1 -1
  13. {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info/licenses}/LICENSE.txt +20 -20
  14. noshot/data/ML TS XAI/ML/1. PCA - EDA.ipynb +0 -207
  15. noshot/data/ML TS XAI/ML/2. KNN Classifier.ipynb +0 -287
  16. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis.ipynb +0 -83
  17. noshot/data/ML TS XAI/ML/4. Linear Regression.ipynb +0 -117
  18. noshot/data/ML TS XAI/ML/5. Logistic Regression.ipynb +0 -151
  19. noshot/data/ML TS XAI/ML/6. Bayesian Classifier.ipynb +0 -89
  20. noshot/data/ML TS XAI/ML/data/balance-scale.csv +0 -626
  21. noshot/data/ML TS XAI/ML/data/balance-scale.txt +0 -625
  22. noshot/data/ML TS XAI/ML/data/machine-data.csv +0 -210
  23. noshot/data/ML TS XAI/ML/data/wine-dataset.csv +0 -179
  24. noshot/data/ML TS XAI/ML Additional/Bank.ipynb +0 -74
  25. noshot/data/ML TS XAI/ML Additional/LR.ipynb +0 -69
  26. noshot/data/ML TS XAI/ML Additional/ObesityDataSet_raw_and_data_sinthetic.csv +0 -2112
  27. noshot/data/ML TS XAI/ML Additional/Q4 LR.csv +0 -206
  28. noshot/data/ML TS XAI/ML Additional/Q7 BANK DETAILS.csv +0 -41189
  29. noshot/data/ML TS XAI/ML Additional/airfoil.ipynb +0 -69
  30. noshot/data/ML TS XAI/ML Additional/airfoil_self_noise.dat +0 -1503
  31. noshot/data/ML TS XAI/ML Additional/obesity.ipynb +0 -78
  32. noshot/data/ML TS XAI/ML Additional/voronoicode.ipynb +0 -81
  33. noshot/data/ML TS XAI/ML Lab CIA/1/1.ipynb +0 -133
  34. noshot/data/ML TS XAI/ML Lab CIA/1/Question.txt +0 -12
  35. noshot/data/ML TS XAI/ML Lab CIA/1/airfoil_self_noise.dat +0 -1503
  36. noshot/data/ML TS XAI/ML Lab CIA/2/2.ipynb +0 -139
  37. noshot/data/ML TS XAI/ML Lab CIA/2/Question.txt +0 -12
  38. noshot/data/ML TS XAI/ML Lab CIA/2/pop_failures.dat +0 -143
  39. noshot/data/ML TS XAI/ML Lab CIA/3/3.ipynb +0 -130
  40. noshot/data/ML TS XAI/ML Lab CIA/3/Qu.txt +0 -1
  41. noshot/data/ML TS XAI/ML Lab CIA/3/go_track_tracks.csv +0 -164
  42. noshot/data/ML TS XAI/ML Lab CIA/4/4.ipynb +0 -141
  43. noshot/data/ML TS XAI/ML Lab CIA/4/Wilt.csv +0 -4340
  44. noshot/data/ML TS XAI/ML Lab CIA/4/qu.txt +0 -1
  45. noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data.ipynb +0 -247
  46. noshot/data/ML TS XAI/TS/2. Feature Engineering.ipynb +0 -183
  47. noshot/data/ML TS XAI/TS/3. Temporal Relationships.ipynb +0 -172
  48. noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interpolation.ipynb +0 -146
  49. noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality.ipynb +0 -173
  50. noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation.ipynb +0 -77
  51. noshot/data/ML TS XAI/TS/AllinOne.ipynb +0 -1416
  52. noshot/data/ML TS XAI/TS/data/daily-min-temperatures.csv +0 -3651
  53. noshot/data/ML TS XAI/TS/data/daily-total-female-births.csv +0 -366
  54. noshot/data/ML TS XAI/TS/data/raw_sales.csv +0 -29581
  55. noshot/data/ML TS XAI/TS/data/shampoo_sales.csv +0 -37
  56. noshot/data/ML TS XAI/TS Lab CIA/1 - AirPassengers/1 - AirPassengers.ipynb +0 -198
  57. noshot/data/ML TS XAI/TS Lab CIA/1 - AirPassengers/AirPassengers.csv +0 -145
  58. noshot/data/ML TS XAI/TS Lab CIA/2 - Daily-total-female-births/2 - daily-total-female-births.ipynb +0 -209
  59. noshot/data/ML TS XAI/TS Lab CIA/2 - Daily-total-female-births/daily-total-female-births.csv +0 -366
  60. noshot/data/ML TS XAI/TS Lab CIA/3 - Bill Charge/3 - Bill Charge.ipynb +0 -169
  61. noshot/data/ML TS XAI/TS Lab CIA/3 - Bill Charge/bill charge.csv +0 -21
  62. noshot/data/ML TS XAI/TS Lab CIA/4 - Daily min temperatures/4 - daily-min-temperatures.ipynb +0 -181
  63. noshot/data/ML TS XAI/TS Lab CIA/4 - Daily min temperatures/daily-min-temperatures.csv +0 -3651
  64. noshot/data/ML TS XAI/TS Lab CIA/5 - shampoo sales/5 - Shampoo sales.ipynb +0 -213
  65. noshot/data/ML TS XAI/TS Lab CIA/5 - shampoo sales/shampoo_sales.csv +0 -37
  66. noshot/data/ML TS XAI/TS Lab CIA/Questions TMS 27 Feb 25.pdf +0 -0
  67. noshot-0.3.9.dist-info/RECORD +0 -62
  68. {noshot-0.3.9.dist-info → noshot-0.4.1.dist-info}/top_level.txt +0 -0
noshot/main.py CHANGED
@@ -1,19 +1,19 @@
1
- from noshot.utils.shell_utils import get_folder
2
- from noshot.utils.shell_utils import get_file
3
- from noshot.utils.shell_utils import remove_folder
4
-
5
- available = {'-1 ' : "ML TS XAI(Folder)",
6
- '0 ' : "Remove Folder"}
7
-
8
- def get(name = None, open = False):
9
- try:
10
- if name is not None:
11
- name = str(name)
12
- if name in ['-1'] : get_folder("ML TS XAI", loc = True)
13
- elif name in ['0'] : remove_folder("ML TS XAI")
14
- else:
15
- for k, v in available.items():
16
- sep = " : " if v else ""
17
- print(k,v,sep = sep)
18
- except Exception as error:
1
+ from noshot.utils.shell_utils import get_folder
2
+ from noshot.utils.shell_utils import get_file
3
+ from noshot.utils.shell_utils import remove_folder
4
+
5
+ available = {'-1 ' : "ML TS XAI(Folder)",
6
+ '0 ' : "Remove Folder"}
7
+
8
+ def get(name = None, open = False):
9
+ try:
10
+ if name is not None:
11
+ name = str(name)
12
+ if name in ['-1'] : get_folder("ML TS XAI", loc = True)
13
+ elif name in ['0'] : remove_folder("ML TS XAI")
14
+ else:
15
+ for k, v in available.items():
16
+ sep = " : " if v else ""
17
+ print(k,v,sep = sep)
18
+ except Exception as error:
19
19
  print(error)
noshot/utils/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- from .shell_utils import get_file
2
- from .shell_utils import get_folder
1
+ from .shell_utils import get_file
2
+ from .shell_utils import get_folder
3
3
  from .shell_utils import remove_folder
@@ -1,57 +1,57 @@
1
- import os
2
- import shutil
3
- import subprocess
4
- import pathlib
5
-
6
- def get_folder(folder_path, loc = False):
7
- src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(folder_path))
8
- try:
9
- dest = os.path.join(os.getcwd(), pathlib.Path(folder_path))
10
- shutil.copytree(src, dest, symlinks=False, copy_function = shutil.copy2,
11
- ignore=shutil.ignore_patterns('.ipynb_checkpoints', '__init__.py', '__pycache__'),
12
- ignore_dangling_symlinks=False, dirs_exist_ok=True)
13
- except:
14
- try:
15
- dest = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path))
16
- shutil.copytree(src, dest, symlinks=False, copy_function = shutil.copy2,
17
- ignore=shutil.ignore_patterns('.ipynb_checkpoints', '__init__.py', '__pycache__'),
18
- ignore_dangling_symlinks=False, dirs_exist_ok=True)
19
- except Exception as error:
20
- print(error)
21
- return
22
- finally:
23
- if loc:
24
- print("Path:",dest)
25
-
26
- def get_file(file_path, loc = False, open = False):
27
- src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(file_path))
28
- try:
29
- dest = os.path.join(os.getcwd(), pathlib.Path(file_path).name)
30
- shutil.copy(src, dest)
31
- if open:
32
- subprocess.Popen(f"jupyter notebook {dest}")
33
- except:
34
- try:
35
- dest = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(file_path).name)
36
- shutil.copy(src, dest)
37
- except Exception as error:
38
- print(error)
39
- finally:
40
- if loc:
41
- print("Path:",dest)
42
-
43
- def remove_folder(folder_path):
44
- try:
45
- src1 = os.path.join(os.getcwd(), pathlib.Path(folder_path))
46
- src2 = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path))
47
- if os.path.exists(src1) or os.path.exists(src2):
48
- shutil.rmtree(src1, ignore_errors = True)
49
- shutil.rmtree(src2, ignore_errors = True)
50
- if os.path.exists(src1) or os.path.exists(src2):
51
- print("Deletion Impossible [File Not Closed - Shutdown File Kernel]\nGo to Home page -> Running Tab -> Click Shut Down All")
52
- else:
53
- print(f"Folder({pathlib.Path(folder_path)}) Removed Successfully")
54
- else:
55
- print(f"Folder({pathlib.Path(folder_path)}) Not Found [Repeated Iteration | Probably Removed Manually]")
56
- except Exception as error:
1
+ import os
2
+ import shutil
3
+ import subprocess
4
+ import pathlib
5
+
6
+ def get_folder(folder_path, loc = False):
7
+ src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(folder_path))
8
+ try:
9
+ dest = os.path.join(os.getcwd(), pathlib.Path(folder_path))
10
+ shutil.copytree(src, dest, symlinks=False, copy_function = shutil.copy2,
11
+ ignore=shutil.ignore_patterns('.ipynb_checkpoints', '__init__.py', '__pycache__'),
12
+ ignore_dangling_symlinks=False, dirs_exist_ok=True)
13
+ except:
14
+ try:
15
+ dest = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path))
16
+ shutil.copytree(src, dest, symlinks=False, copy_function = shutil.copy2,
17
+ ignore=shutil.ignore_patterns('.ipynb_checkpoints', '__init__.py', '__pycache__'),
18
+ ignore_dangling_symlinks=False, dirs_exist_ok=True)
19
+ except Exception as error:
20
+ print(error)
21
+ return
22
+ finally:
23
+ if loc:
24
+ print("Path:",dest)
25
+
26
+ def get_file(file_path, loc = False, open = False):
27
+ src = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", pathlib.Path(file_path))
28
+ try:
29
+ dest = os.path.join(os.getcwd(), pathlib.Path(file_path).name)
30
+ shutil.copy(src, dest)
31
+ if open:
32
+ subprocess.Popen(f"jupyter notebook {dest}")
33
+ except:
34
+ try:
35
+ dest = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(file_path).name)
36
+ shutil.copy(src, dest)
37
+ except Exception as error:
38
+ print(error)
39
+ finally:
40
+ if loc:
41
+ print("Path:",dest)
42
+
43
+ def remove_folder(folder_path):
44
+ try:
45
+ src1 = os.path.join(os.getcwd(), pathlib.Path(folder_path))
46
+ src2 = os.path.join(os.path.expanduser('~'), "Downloads", pathlib.Path(folder_path))
47
+ if os.path.exists(src1) or os.path.exists(src2):
48
+ shutil.rmtree(src1, ignore_errors = True)
49
+ shutil.rmtree(src2, ignore_errors = True)
50
+ if os.path.exists(src1) or os.path.exists(src2):
51
+ print("Deletion Impossible [File Not Closed - Shutdown File Kernel]\nGo to Home page -> Running Tab -> Click Shut Down All")
52
+ else:
53
+ print(f"Folder({pathlib.Path(folder_path)}) Removed Successfully")
54
+ else:
55
+ print(f"Folder({pathlib.Path(folder_path)}) Not Found [Repeated Iteration | Probably Removed Manually]")
56
+ except Exception as error:
57
57
  print(error)
@@ -1,55 +1,58 @@
1
- Metadata-Version: 2.2
2
- Name: noshot
3
- Version: 0.3.9
4
- Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
- Author: Tim Stan S
6
- License: MIT
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: Programming Language :: Python :: 3.7
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.7
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE.txt
18
- Dynamic: author
19
- Dynamic: classifier
20
- Dynamic: description
21
- Dynamic: description-content-type
22
- Dynamic: license
23
- Dynamic: requires-python
24
- Dynamic: summary
25
-
26
- <h1 align="center">No Shot</h1>
27
-
28
- <p align="center">
29
- <img src="https://i.ibb.co/XkjpGzzL/noshot.jpg" alt="No Shot Image" width="400">
30
- </p>
31
-
32
- ![Static Badge](https://img.shields.io/badge/OneShotCoding-NoShot-blue?logoColor=yell)
33
- [![PyPI - Version](https://img.shields.io/pypi/v/noshot)](https://pypi.org/project/noshot)
34
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/suganthangnanavelan/one-shot-coding/blob/main/LICENSE.txt)
35
- [![Pepy Total Downloads](https://img.shields.io/pepy/dt/noshot)](https://pepy.tech/projects/noshot)
36
- ![Python Versions](https://img.shields.io/pypi/pyversions/noshot.svg?logo=python&color=yellow)
37
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/suganthangnanavelan/one-shot-coding/test.yml)
38
-
39
- <p align="center">
40
- A powerful support library that enhances the capabilities of NumPy, Pandas, and Matplotlib by providing additional algorithms, visualizations, and utilities.
41
- </p>
42
-
43
- ## 🚀 **Overview**
44
- `NoShot` is a utility library that acts as a **support dependency** for larger modules like **NumPy, Pandas, and Matplotlib**. It enhances their functionality by introducing:
45
- - 📊 **Custom visualizations** built on top of Matplotlib.
46
- - 📈 **Optimized algorithms** for data processing.
47
- - **Additional utilities** for working with structured data.
48
-
49
- > [!NOTE]
50
- > This package is **not a replacement** for NumPy or Pandas but extends their features to simplify complex operations.
51
-
52
- ## 📦 **Installation**
53
- Install latest version via `pip`:
54
- ```sh
55
- pip install noshot
1
+ Metadata-Version: 2.4
2
+ Name: noshot
3
+ Version: 0.4.1
4
+ Summary: Support library for Artificial Intelligence, Machine Learning and Data Science tools
5
+ Author: Tim Stan S
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.7
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Requires-Python: >=3.7
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE.txt
20
+ Dynamic: author
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: requires-python
27
+ Dynamic: summary
28
+
29
+ <h1 align="center">No Shot</h1>
30
+
31
+ <p align="center">
32
+ <img src="https://i.ibb.co/XkjpGzzL/noshot.jpg" alt="No Shot Image" width="400">
33
+ </p>
34
+
35
+ ![Static Badge](https://img.shields.io/badge/OneShotCoding-NoShot-blue?logoColor=yell)
36
+ [![PyPI - Version](https://img.shields.io/pypi/v/noshot)](https://pypi.org/project/noshot)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/suganthangnanavelan/one-shot-coding/blob/main/LICENSE.txt)
38
+ [![Pepy Total Downloads](https://img.shields.io/pepy/dt/noshot)](https://pepy.tech/projects/noshot)
39
+ ![Python Versions](https://img.shields.io/pypi/pyversions/noshot.svg?logo=python&color=yellow)
40
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/suganthangnanavelan/one-shot-coding/test.yml)
41
+
42
+ <p align="center">
43
+ A powerful support library that enhances the capabilities of NumPy, Pandas, and Matplotlib by providing additional algorithms, visualizations, and utilities.
44
+ </p>
45
+
46
+ ## 🚀 **Overview**
47
+ `NoShot` is a utility library that acts as a **support dependency** for larger modules like **NumPy, Pandas, and Matplotlib**. It enhances their functionality by introducing:
48
+ - 📊 **Custom visualizations** built on top of Matplotlib.
49
+ - 📈 **Optimized algorithms** for data processing.
50
+ - **Additional utilities** for working with structured data.
51
+
52
+ > [!NOTE]
53
+ > This package is **not a replacement** for NumPy or Pandas but extends their features to simplify complex operations.
54
+
55
+ ## 📦 **Installation**
56
+ Install latest version via `pip`:
57
+ ```sh
58
+ pip install noshot
@@ -0,0 +1,15 @@
1
+ noshot/__init__.py,sha256=000R40tii8lDFU8C1fBaD3SOnxD0PWRNWZU-km49YrU,21
2
+ noshot/main.py,sha256=zXegIqjJPARlPnQMS-B2dAENcvyaZkNwmue63Gm8lHU,663
3
+ noshot/data/ML TS XAI/TS/10. Seasonal ARIMA Forecasting.ipynb,sha256=xxULVtvV34EEPL8phGQimycRwNXlJr1N8LVl35iv72I,638153
4
+ noshot/data/ML TS XAI/TS/11. Multivariate ARIMA Forecasting.ipynb,sha256=33Q1Tu5pVL8KkB-X6uRgrXQNVdsxYvHyOvU_m3PuXoo,373423
5
+ noshot/data/ML TS XAI/TS/6. ACF PACF.ipynb,sha256=VHZ-Hzy4v5VsU9BOsFaQCUZHFLz1sgTaiCKyEY-6RK8,179141
6
+ noshot/data/ML TS XAI/TS/7. Differencing.ipynb,sha256=70qBjKGvO0b0HDQcmTLJgrC8EtwrO39Ytodbum_2Lf0,372620
7
+ noshot/data/ML TS XAI/TS/8. ARMA Forecasting.ipynb,sha256=bs1-eRNC_b0xWarl-JZvzRdhjDLZyo8a34yHYjzmweQ,449962
8
+ noshot/data/ML TS XAI/TS/9. ARIMA Forecasting.ipynb,sha256=yssDftBhYIMG9gJCQR2yie6ffWG0fgx3cwY8tZINetQ,379086
9
+ noshot/utils/__init__.py,sha256=QVrN1ZpzPXxZqDOqot5-t_ulFjZXVx7Cvr-Is9AK0po,110
10
+ noshot/utils/shell_utils.py,sha256=-XfgYlNQlULa_rRJ3vsfTns4m_jiueGEj396J_y0Gus,2611
11
+ noshot-0.4.1.dist-info/licenses/LICENSE.txt,sha256=fgCruaVm5cUjFGOeEoGIimT6nnUunBqcNZHpGzK8TSw,1086
12
+ noshot-0.4.1.dist-info/METADATA,sha256=cxNOQK9zV4tZXDdzTGTVM92hfg1rMYTIUyU73pkgrF8,2573
13
+ noshot-0.4.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
+ noshot-0.4.1.dist-info/top_level.txt,sha256=UL-c0HffdRwohz-y9icY_rnY48pQDdxGcBsgyCKh2Q8,7
15
+ noshot-0.4.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 The author
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1
+ MIT License
2
+
3
+ Copyright (c) 2025 The author
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
@@ -1,207 +0,0 @@
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('data/balance-scale.txt', delimiter = ',', names = ['class name', 'left-weight', 'left-distance', 'right-weight', 'right-distance'])\n",
35
- "#df = pd.read_csv('data/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
- }