layeredlearning 1.1.1__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.
- layeredlearning-1.1.1/.vscode/settings.json +5 -0
- layeredlearning-1.1.1/LICENSE +21 -0
- layeredlearning-1.1.1/PKG-INFO +134 -0
- layeredlearning-1.1.1/README.md +94 -0
- layeredlearning-1.1.1/catboost_info/catboost_training.json +1004 -0
- layeredlearning-1.1.1/catboost_info/learn/events.out.tfevents +0 -0
- layeredlearning-1.1.1/catboost_info/learn_error.tsv +1001 -0
- layeredlearning-1.1.1/catboost_info/time_left.tsv +1001 -0
- layeredlearning-1.1.1/datasets/BankNoteAuthentication.csv +1373 -0
- layeredlearning-1.1.1/datasets/Sonar.csv +209 -0
- layeredlearning-1.1.1/datasets/Spam.csv +4602 -0
- layeredlearning-1.1.1/datasets/balance-scale.csv +626 -0
- layeredlearning-1.1.1/datasets/bank-full.csv +45212 -0
- layeredlearning-1.1.1/datasets/bank.csv +4522 -0
- layeredlearning-1.1.1/datasets/blood.csv +749 -0
- layeredlearning-1.1.1/datasets/clean_dataset.csv +691 -0
- layeredlearning-1.1.1/datasets/crx.csv +690 -0
- layeredlearning-1.1.1/datasets/dermatology_database_1.csv +367 -0
- layeredlearning-1.1.1/datasets/dna.csv +3187 -0
- layeredlearning-1.1.1/datasets/electricity.csv +45313 -0
- layeredlearning-1.1.1/datasets/mushrooms.csv +8125 -0
- layeredlearning-1.1.1/datasets/nursery.csv +12961 -0
- layeredlearning-1.1.1/datasets/yeast.csv +1485 -0
- layeredlearning-1.1.1/pyproject.toml +35 -0
- layeredlearning-1.1.1/results/classification_default_dataset.png +0 -0
- layeredlearning-1.1.1/results/regression_default_dataset.png +0 -0
- layeredlearning-1.1.1/src/layerlearn/__init__.py +6 -0
- layeredlearning-1.1.1/src/layerlearn/baseLR.py +516 -0
- layeredlearning-1.1.1/src/layerlearn/flexiblestacked.py +77 -0
- layeredlearning-1.1.1/testing/classification_default_dataset.py +112 -0
- layeredlearning-1.1.1/testing/instantiation_checking.py +22 -0
- layeredlearning-1.1.1/testing/regression_default_dataset.py +119 -0
- layeredlearning-1.1.1/testing/test.py +21 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2025] [Yashwant Singh Rawat]
|
|
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 THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: layeredlearning
|
|
3
|
+
Version: 1.1.1
|
|
4
|
+
Summary: A simple library for flexible model stacking in scikit-learn.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Mr-J12/newalgo
|
|
6
|
+
Author-email: Yashwant Singh Rawat <yashwantsinghrawat696@gmail.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) [2025] [Yashwant Singh Rawat]
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Classifier: Intended Audience :: Developers
|
|
30
|
+
Classifier: Operating System :: OS Independent
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
33
|
+
Requires-Python: >=3.8
|
|
34
|
+
Requires-Dist: catboost>=1.2.2
|
|
35
|
+
Requires-Dist: lightgbm>=3.3.5
|
|
36
|
+
Requires-Dist: numpy>=1.20.0
|
|
37
|
+
Requires-Dist: scikit-learn>=1.0.0
|
|
38
|
+
Requires-Dist: xgboost>=1.7.0
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# LayerLearn — Flexible Model Library
|
|
43
|
+
|
|
44
|
+
layerlearn is a small Python package that makes it easy to build stacked estimators (regressors and classifiers) around scikit-learn models.
|
|
45
|
+
|
|
46
|
+
## Requirements
|
|
47
|
+
|
|
48
|
+
- Python 3.8+
|
|
49
|
+
- scikit-learn
|
|
50
|
+
- numpy
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
From PyPI:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install layerlearnyashw
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
From source (recommended for development):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/Mr-J12/newalgo.git
|
|
64
|
+
cd newalgo
|
|
65
|
+
pip install -e .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Examples & tests
|
|
69
|
+
|
|
70
|
+
See example scripts in the repository:
|
|
71
|
+
|
|
72
|
+
- testing/regression_default_dataset.py
|
|
73
|
+
- testing/classification_default_dataset.py
|
|
74
|
+
- testing/instantiation_checking.py
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Quick examples
|
|
78
|
+
|
|
79
|
+
### Regression:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from layerlearn.flexiblestacked import FlexibleStackedRegressor
|
|
83
|
+
from sklearn.linear_model import LinearRegression
|
|
84
|
+
from sklearn.ensemble import RandomForestRegressor
|
|
85
|
+
from sklearn.datasets import make_regression
|
|
86
|
+
from sklearn.model_selection import train_test_split
|
|
87
|
+
|
|
88
|
+
X, y = make_regression(n_samples=200, n_features=10, noise=10)
|
|
89
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
|
|
90
|
+
|
|
91
|
+
base = LinearRegression()
|
|
92
|
+
meta = RandomForestRegressor(random_state=0)
|
|
93
|
+
stack = FlexibleStackedRegressor(base, meta)
|
|
94
|
+
stack.fit(X_train, y_train)
|
|
95
|
+
preds = stack.predict(X_test)
|
|
96
|
+
print(preds[:5])
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Classification:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from layerlearn.flexiblestacked import FlexibleStackedClassifier
|
|
103
|
+
from sklearn.linear_model import LogisticRegression
|
|
104
|
+
from sklearn.ensemble import RandomForestClassifier
|
|
105
|
+
from sklearn.datasets import make_classification
|
|
106
|
+
from sklearn.model_selection import train_test_split
|
|
107
|
+
|
|
108
|
+
X, y = make_classification(n_samples=200, n_features=10, n_classes=2, random_state=0)
|
|
109
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
|
|
110
|
+
|
|
111
|
+
base = LogisticRegression(max_iter=1000)
|
|
112
|
+
meta = RandomForestClassifier(random_state=0)
|
|
113
|
+
stack = FlexibleStackedClassifier(base, meta)
|
|
114
|
+
stack.fit(X_train, y_train)
|
|
115
|
+
preds = stack.predict(X_test)
|
|
116
|
+
print(preds[:5])
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Visualization
|
|
120
|
+
|
|
121
|
+
### Regression Default Dataset Report
|
|
122
|
+

|
|
123
|
+
### Classification Default Dataset Report
|
|
124
|
+

|
|
125
|
+
|
|
126
|
+
## Development
|
|
127
|
+
|
|
128
|
+
- Install development requirements (scikit-learn, numpy).
|
|
129
|
+
- Run example scripts to verify behavior:
|
|
130
|
+
python testing/regression_default_dataset.py
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
See LICENSE for details.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
# LayerLearn — Flexible Model Library
|
|
3
|
+
|
|
4
|
+
layerlearn is a small Python package that makes it easy to build stacked estimators (regressors and classifiers) around scikit-learn models.
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- Python 3.8+
|
|
9
|
+
- scikit-learn
|
|
10
|
+
- numpy
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
From PyPI:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install layerlearnyashw
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
From source (recommended for development):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git clone https://github.com/Mr-J12/newalgo.git
|
|
24
|
+
cd newalgo
|
|
25
|
+
pip install -e .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Examples & tests
|
|
29
|
+
|
|
30
|
+
See example scripts in the repository:
|
|
31
|
+
|
|
32
|
+
- testing/regression_default_dataset.py
|
|
33
|
+
- testing/classification_default_dataset.py
|
|
34
|
+
- testing/instantiation_checking.py
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Quick examples
|
|
38
|
+
|
|
39
|
+
### Regression:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from layerlearn.flexiblestacked import FlexibleStackedRegressor
|
|
43
|
+
from sklearn.linear_model import LinearRegression
|
|
44
|
+
from sklearn.ensemble import RandomForestRegressor
|
|
45
|
+
from sklearn.datasets import make_regression
|
|
46
|
+
from sklearn.model_selection import train_test_split
|
|
47
|
+
|
|
48
|
+
X, y = make_regression(n_samples=200, n_features=10, noise=10)
|
|
49
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
|
|
50
|
+
|
|
51
|
+
base = LinearRegression()
|
|
52
|
+
meta = RandomForestRegressor(random_state=0)
|
|
53
|
+
stack = FlexibleStackedRegressor(base, meta)
|
|
54
|
+
stack.fit(X_train, y_train)
|
|
55
|
+
preds = stack.predict(X_test)
|
|
56
|
+
print(preds[:5])
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Classification:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from layerlearn.flexiblestacked import FlexibleStackedClassifier
|
|
63
|
+
from sklearn.linear_model import LogisticRegression
|
|
64
|
+
from sklearn.ensemble import RandomForestClassifier
|
|
65
|
+
from sklearn.datasets import make_classification
|
|
66
|
+
from sklearn.model_selection import train_test_split
|
|
67
|
+
|
|
68
|
+
X, y = make_classification(n_samples=200, n_features=10, n_classes=2, random_state=0)
|
|
69
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
|
|
70
|
+
|
|
71
|
+
base = LogisticRegression(max_iter=1000)
|
|
72
|
+
meta = RandomForestClassifier(random_state=0)
|
|
73
|
+
stack = FlexibleStackedClassifier(base, meta)
|
|
74
|
+
stack.fit(X_train, y_train)
|
|
75
|
+
preds = stack.predict(X_test)
|
|
76
|
+
print(preds[:5])
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Visualization
|
|
80
|
+
|
|
81
|
+
### Regression Default Dataset Report
|
|
82
|
+

|
|
83
|
+
### Classification Default Dataset Report
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
## Development
|
|
87
|
+
|
|
88
|
+
- Install development requirements (scikit-learn, numpy).
|
|
89
|
+
- Run example scripts to verify behavior:
|
|
90
|
+
python testing/regression_default_dataset.py
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
See LICENSE for details.
|