Reparo is a python sci-kit learn inspired package for Missing Value Imputation.
Project description
reparo
Reparo is a python sci-kit learn inspired package for Missing Value Imputation. It contains a some feature transformers to eliminate Missing Values (NaNs) from your data for Machine Learning Algorithms.
This version of reparo has the next methods of missing value imputation:
- Cold-Deck Imputation (CDI).
- Hot-Deck Imputation (HotDeckImputation).
- Fuzzy-Rough Nearest Neighbor for Imputation (FRNNI).
- K-Nearest Neighbors Imputation (KNNI).
- Single Center Imputation from Multiple Chained Equation (SICE).
- Predictive Mean Matching (PMM).
- Multivariate Imputation by Chained Equation (MICE).
All these methods work like normal sklearn transformers. They have fit, transform and fit_transform functions implemented.
Additionally every reparo transformer has an apply function which allows to apply an transformation on a pandas Data Frame.
How to use reparo
To use a transformer from reparo you should just import the transformer from reparo in the following framework:
from reparo import <class name>
class names are written above in parantheses.
Next create a object of this algorithm (I will use k-Nearest Neighbors Imputation as an example).
method = KNNI()
Firstly you should fit the transformer, passing to it a feature matrix (X) and the target array (y). y argument is not really used (as it causes data leackage)
method.fit(X, y)
After you fit the model, you can use it for transforming new data, using the transform function. To transform function you should pass only the feature matrix (X).
X_transformed = method.transform(X)
Also you can fit and transform the data at the same time using the fit_transform function.
X_transformed = method.fit_transform(X)
Also you can apply a transformation directly on a pandas DataFrame, choosing the columns that you want to change.
new_df = method.apply(df, 'target', ['col1', 'col2'])
With <3 from Sigmoid. We are open for feedback. Please send your impression to papaluta.vasile@isa.utm.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file reparo-0.0.2.tar.gz
.
File metadata
- Download URL: reparo-0.0.2.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.40.0 importlib-metadata/0.23 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa006934a6270a50743bb940b30327086af7c466d234b31d8b1c63649c37a8b3 |
|
MD5 | 902f7d2a89fc9be1fdc0314b9afb7099 |
|
BLAKE2b-256 | bb6f2ee83f7ca67639f34a01cd19bf08d5aee496d74791f4e028b0dd24998d03 |
File details
Details for the file reparo-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: reparo-0.0.2-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.40.0 importlib-metadata/0.23 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 551925e90539445c19561cebee97f67a37466ce81579a2afc7af3fa13bb6f718 |
|
MD5 | 0c82d256d705e39bbc3aa981d5f2fce9 |
|
BLAKE2b-256 | c72c347873690a3ddd5034896fae537bca94c4fec8c87c55d06d3edd40af2e0b |