Prepnet
Reconstructable preprocessor library.
There are concepts of this library.
- All pre-processes can save as a pickle.
- Reconstructable pre-processes for feature analysis
Example
A simple example is see examples/01_iris.ipynb There is pre-process using prepnet for iris dataset in a part of example.
import prepnet
from sklearn import datasets
# Load dataset.
iris = datasets.load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['target'] = iris.target_names[iris.target]
# Scale by std and mean, and split 5 folds.
context = prepnet.FunctionalContext()
with context.enter('normalize'):
# All pre-process method allow method chain.
context[
'sepal length (cm)',
'sepal width (cm)',
'petal length (cm)',
'petal width (cm)',
].standardize()
# context.post is execute always after other preprocesses.
with context.enter('post'):
context.split()
# convert python list object from prepnet.DataFrameArray.
preprocessed_df_list = list(context.encode(df))
# Concat first 4 element for train dataset.
train_df = pd.concat(preprocessed_df_list[:4], axis=0)
# Use last element for test dataset.
test_df = preprocessed_df_list[-1]
And above preprocessor context can disable normalize easily
new_context = context.disable()
preprocessed_df_list = list(context.encode(df))
# Concat first 4 element for train dataset
nonnorm_train_df = pd.concat(preprocessed_df_list[:4], axis=0)
# Use last element for test dataset
nonnorm_test_df = preprocessed_df_list[-1]
Do you ever remember this?
Boss: Hey, what's the difference between the new results and the old ones?
Someone: Well, some preprocesses are different.
Boss: Okay. Let me see the dataset.
Someone: Yes, sir. It's this and this.
Boss: What's the difference two datasets? The value that comes out of the difference is slightly, what's the difference in the preprocess?
Someone: Well, I just don't know.
Boss: Why? The dataset contains a commit idand you're managing source codes with git.
Someone: Even if I knew what version of the dataset it was created from. I would have commented out the details and preprocessed it...
Boss: Hey you...
Install
pip install prepnet
or
git clone https://github.com/elda27/prepnet
cd prepnet
python setup.py install
Test
python -m pytest --cov=prepnet
Metadata
Release files for prepnet 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prepnet-0.2.0.tar.gz | 12.3 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prepnet-0.2.0-py3.7.egg | Legacy Egg format | - | - | Details |
| prepnet-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.3 kB
Release files / prepnet-0.2.0.tar.gz
| Download URL | prepnet-0.2.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
406c94ffe0b3ef40de3745eaf07f36efc5dc5b9ec517882ff846ac4132dc8ee9
|
|
BLAKE2b-256 checksum How to use checksums |
f6367319a79ac6a8f6b35554b0cca4b8681d58d0b045b1f2c507ca79d7d0c777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Release files / prepnet-0.2.0-py3.7.egg
| Download URL | prepnet-0.2.0-py3.7.egg |
|---|---|
| Size | 64.1 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
56d7b2e93d79e10e12b2958dfff004cff94ebe3db7294f036ac6d6b8c9efad28
|
|
BLAKE2b-256 checksum How to use checksums |
145350738976da1623107f065c8d983b43e55cca9b89c9ca612b6d78db630651
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Release files / prepnet-0.2.0-py3-none-any.whl
| Download URL | prepnet-0.2.0-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31265609578f84339a2c7b450744841e550d0818d6fe437155be5861a49b8429
|
|
BLAKE2b-256 checksum How to use checksums |
9cde2479c829be9c3d63c7e2694c196200f9e8f13c725a3da636d95e7420c483
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|