SKNet
Introduction
SKNet is a new type of neural network that is simple in structure but complex in neuron. Each of its neuron is a traditional estimator such as SVM, RF, etc.
Fetaures
We think that such a network has many applicable scenarios.
- We don't have enough samples to train neural networks.
- We hope to improve the accuracy of the model by means of emsemble.
- We hope to learn some new features.
- We want to save a lot of parameter adjustment time while getting a stable and good model.
Installation
pip install sknet
Example
Computation Graph
Code
from sknet.sequential import Layer,Sequential,SKNeuron
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import AdaBoostRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.svm import LinearSVR
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.neighbors import KNeighborsRegressor
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
data = load_breast_cancer()
features = data.data
target = data.target
X_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.2, random_state=42)
layer1 = Layer([
SKNeuron(RandomForestRegressor,params = {"random_state": 0}),
SKNeuron(GradientBoostingRegressor,params = {"random_state": 0}),
SKNeuron(AdaBoostRegressor,params = {"random_state": 0}),
SKNeuron(KNeighborsRegressor),
SKNeuron(ExtraTreesRegressor,params = {"random_state": 0}),
])
layer2 = Layer([
SKNeuron(AdaBoostRegressor,params = {"random_state": 0}),
SKNeuron(LinearSVR,params = {"random_state": 0}),
])
layer3 = Layer([
SKNeuron(LogisticRegression,params = {"random_state": 0}),
])
model = Sequential([layer1,layer2,layer3],n_splits = 5)
y_pred = model.fit_predict(X_train,y_train, X_test)
print(model.score(y_test,y_pred))
# acc = 0.9736842105263158
Todo
- Two or three level stacking
- multi-processing
- features proxy
Metadata
Release files for SKNet 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SKNet-0.0.1.tar.gz | 3.2 kB | Without provenance | Details for SKNet-0.0.1.tar.gz |
Release files / SKNet-0.0.1.tar.gz
| Download URL | SKNet-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffcb669c4a20230b3ccef30ca837915ae0b14bbe13129ac97ec66cb4cca3fc11
|
|
BLAKE2b-256 checksum How to use checksums |
7e1ab533ba48054794b41898f4cccd18387586a6b4c568975e696c3ae5692e71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.3
|
Security for SKNet 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.