Description
This is an easy to use library to encode categorical data in a feature into optimized set of features with each categorical value mapping to a unique bitstring.
>>> import optiEncoder
>>> enc = optiEncoder.Encoder(["France","Canada","England"])
>>> print("Mappings : ", enc.getMappings())
{'France':[0,0],'Canada':[0,1],'England':[1,0]}
>>> print("Encoded List : ", enc.getEncodedList())
[[0,0],[0,1],[1,0]]
Usage in Data Preprocessing
>>> import optiEncoder
>>> import pandas
>>> d = pd.read_csv('data.csv').dropna()
Performance Measure BRATS 2018
0 Dice Coefficient 90
1 Jaccard Coefficient 80
2 Area under ROC 90
4 Hausdorff Distance 10
5 Sensitivity 90
6 Specificity 90
7 F-Measure 90
8 Precision 80
9 Vol Similarity Distance 90
10 Fallout 7
12 TP 1900
13 FP 200
14 TN 2500
15 FN 600
>>> enc = optiEncoder.Encoder(list('Performance Measure'))
>>> enc.getEncodedList()
[[1, 0, 0, 1], [1, 1, 0, 0], [1, 0, 0, 0], [0, 1, 1, 1], [0, 1, 0, 0], [1, 0, 0, 0], [0, 1, 1, 0], [1, 0, 1, 0], [0, 0, 1, 1], [1, 0, 1, 1], [1, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [1, 1, 0, 0], [1, 0, 1, 0], [0, 1, 0, 1], [0, 0, 0, 0], [1, 0, 0, 0], [1, 1, 0, 0]]
>>> d = d.iloc[:,1:]
>>> d
BRATS 2018
0 90
1 80
2 90
4 10
5 90
6 90
7 90
8 80
9 90
10 7
12 1900
13 200
14 2500
15 600
>>> encodedList = enc.getEncodedList()
>>> for i in range(0,len(encodedList[0])):
... d[str(i)]=pd.DataFrame(encodedList).iloc[:,i]
...
>>> d
BRATS 2018 0 1 2 3
0 90 1 0 0 1
1 80 1 1 0 0
2 90 1 0 0 0
4 10 0 1 0 0
5 90 1 0 0 0
6 90 0 1 1 0
7 90 1 0 1 0
8 80 0 0 1 1
9 90 1 0 1 1
10 7 1 1 0 0
12 1900 0 0 1 0
13 200 1 1 0 0
14 2500 1 0 1 0
15 600 0 1 0 1
License
MIT
Author
Sahil Ahuja
Metadata
Release files for python-optiEncoder 2.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 |
|---|---|---|---|---|
| python-optiEncoder-2.0.1.tar.gz | 2.9 kB | Without provenance | Details for python-optiEncoder-2.0.1.tar.gz |
Release files / python-optiEncoder-2.0.1.tar.gz
| Download URL | python-optiEncoder-2.0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
260ae84df80984b01843c18e6f4397c304fd171352b7c766f392308c125ce817
|
|
BLAKE2b-256 checksum How to use checksums |
2908bbb5fc574a7711c09262e49435cdaef9471e1286ee5946b5d1a0a3b096ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
|
Security for python-optiEncoder 2.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.