Skip to main content

Impute missing values using faiss

Project description

FaissImputer

PyPI Version License

Impute missing values using faiss - A Python library for missing data imputation with k nearest neighbors.

Installation

You can install faiss-imputer using pip:

pip install faiss-imputer

Usage

import pandas as pd
from faiss_imputer import FaissImputer

# Create your DataFrame and introduce missing values
# ...

# Create an instance of FaissImputer
imputer = FaissImputer(n_neighbors=3)

# Fit the imputer on the data frame with missing values
imputer.fit(df_missing)

# Transform the data frame with missing values
df_imputed = imputer.transform(df_missing)

Parameters

n_neighbors: Number of nearest neighbors to consider for imputation. metric: Distance metric to use for nearest neighbor search ('l2' or 'ip'). strategy: Imputation strategy ('mean' or 'median'). index_factory: Faiss index type ('Flat' or others).

Example

For a detailed example, refer to the example.py file.

Contributing

Contributions are welcome! If you find a bug or have an enhancement suggestion, please open an issue or create a pull request.

License

This project is licensed under the MIT License.

Third-Party Licenses

This project utilizes code from Meta's Faiss library, which is distributed under the Apache License 2.0.

Please note that while this project includes code from the Faiss library, it is not officially associated with or endorsed by the Faiss maintainers or Meta.

For detailed licensing information of the Faiss library, please refer to the Faiss repository.

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

faiss-imputer-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faiss_imputer-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file faiss-imputer-0.1.1.tar.gz.

File metadata

  • Download URL: faiss-imputer-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for faiss-imputer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 54b5bc892a62e7c1cc892bab9eb0ecdef75420c35e27748ae3168a0e7ebd49bb
MD5 723bc70b22c7fd4d5ae47eddf63f1f18
BLAKE2b-256 79ddd9836735621cbaf7e55cefb80e2c51389dd8d53fbd799bad4dfa1deacb14

See more details on using hashes here.

File details

Details for the file faiss_imputer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: faiss_imputer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for faiss_imputer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bcf730e192c77cfaf157fe9c07a221a4c2e90708f38a689afd5e3ecb802bc3d
MD5 3b439807524304312a42dbd91995a4e8
BLAKE2b-256 b9f5903803213b073e4b5253ce59d5355522bf73aaf2186ece4e161e8f1a99b2

See more details on using hashes here.

Supported by

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