Skip to main content

Reparo is a python sci-kit learn inspired package for Missing Value Imputation.

Project description

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:

  1. Cold-Deck Imputation (CDI).

  2. Hot-Deck Imputation (HotDeckImputation).

  3. Fuzzy-Rough Nearest Neighbor for Imputation (FRNNI).

  4. K-Nearest Neighbors Imputation (KNNI).

  5. Single Center Imputation from Multiple Chained Equation (SICE).

  6. Predictive Mean Matching (PMM).

  7. 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 love 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

reparo-0.0.5.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

reparo-0.0.5-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file reparo-0.0.5.tar.gz.

File metadata

  • Download URL: reparo-0.0.5.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for reparo-0.0.5.tar.gz
Algorithm Hash digest
SHA256 85c2830b4615a87a106c40e7ce69a0d7b6d7ac41f13300ee86d6bfa00b659b6b
MD5 3b8d7ab9305fa76968a8a8ae874cebcb
BLAKE2b-256 db54653c3d15a067bd01f7e5a340decb1d599a930ab4d7d51c3da1c5ef90b90e

See more details on using hashes here.

File details

Details for the file reparo-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: reparo-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.2

File hashes

Hashes for reparo-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bccf3aef8d4ab83f0afc6479386ae0601430a48ba300d035a59c72517e27e775
MD5 847e6239c66728fbcd2362e0e92ca46d
BLAKE2b-256 6f3e95e3e4e33138969a47764b7d7f2040d1e5f90c08cbb5bc98a39cb59934e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page