eznorm
下の方に日本語の説明があります
Overview
- Easy to use normalization tool for machine learning.
- Normalization is performed on test data as well as on training parameters to prevent leakage.
- Automatically prevents division by zero for features with a standard deviation of zero
Usage
import eznorm
train_x = [
[1, -10, 0.3],
[2, -5, 0.1],
[1, -10, 0.5],
]
test_x = [[2, -5, 0.2], [1, -7, 0.3]]
# Normalize training data
norm_params = eznorm.fit(train_x) # Fit the data to the normalization parameters (returns normalization parameters) [eznorm]
norm_train_x = eznorm.normalize(train_x, norm_params) # Normalize the data [eznorm]
"""
norm_train_x:
[[-0.70710678 -0.70710678 0. ]
[ 1.41421356 1.41421356 -1.22474487]
[-0.70710678 -0.70710678 1.22474487]]
"""
# Normalize test data
norm_test_x = eznorm.normalize(test_x, norm_params) # Normalize the data [eznorm]
"""
norm_test_x:
[[ 1.41421356 1.41421356 -0.61237244]
[-0.70710678 0.56568542 0. ]]
"""
概要
- 機械学習の正規化処理を簡単に実施するツール
- テストデータに対してもにも学習時のパラメータで正規化を実施することでリーケージを防止
- 標準偏差が0の特徴量に対してのゼロ割りを自動的に防止
使用例
import eznorm
train_x = [
[1, -10, 0.3],
[2, -5, 0.1],
[1, -10, 0.5],
]
test_x = [[2, -5, 0.2], [1, -7, 0.3]]
# 学習データの正規化
norm_params = eznorm.fit(train_x) # 学習データへの適合 (正規化パラメータを返す) [eznorm]
norm_train_x = eznorm.normalize(train_x, norm_params) # データの正規化 [eznorm]
"""
norm_train_x:
[[-0.70710678 -0.70710678 0. ]
[ 1.41421356 1.41421356 -1.22474487]
[-0.70710678 -0.70710678 1.22474487]]
"""
# テストデータの正規化
norm_test_x = eznorm.normalize(test_x, norm_params) # データの正規化 [eznorm]
"""
norm_test_x:
[[ 1.41421356 1.41421356 -0.61237244]
[-0.70710678 0.56568542 0. ]]
"""
Metadata
Release files for eznorm 0.0.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 | Provenance | |
|---|---|---|---|---|
| eznorm-0.0.0.tar.gz | 3.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eznorm-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / eznorm-0.0.0.tar.gz
| Download URL | eznorm-0.0.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89a803083af8873cea5fd134af58b6f1bcf92f397bd5beaae5995d40541fbce8
|
|
BLAKE2b-256 checksum How to use checksums |
0ed0aa4411d6f9994a3c8958251558f0879c4d77c049a8b783526567fec2b317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.8
|
Release files / eznorm-0.0.0-py3-none-any.whl
| Download URL | eznorm-0.0.0-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02b47978f7b28f5de11640c7c278ae16bc079e6b7a7b577c1652fb4e6509a0a1
|
|
BLAKE2b-256 checksum How to use checksums |
8b18a707e95de07db5dbf92f4ef46a7122596abb0e2940f006f9b9396faecbe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.8
|
Security for eznorm 0.0.0
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.