Skip to main content

Automatic Outliers Handler Library

Project description

AnLOF

AnLOF is a machine learning utility library built to automatically handle outliers effectively.

AnLOF uses multiple outlier-handling techniques and automatically selects the best-performing method.


Outlier Handling Methods Used

  • IQR Score
  • Z-score
  • Winsorization
  • Median Imputation
  • Mean Imputation
  • Isolation Forest
  • Box-Cox Transformation
  • k-Nearest Neighbors
  • XGBRegressor
  • LGBMRegressor
  • CatBoostRegressor
  • StandardScaler
  • RobustScaler
  • MinMaxScaler
  • Log Transformation
  • Quantile Normalization

Features

  • Automatic outlier detection and handling
  • Multiple preprocessing strategies
  • Model-based evaluation
  • Selects the best method based on the chosen metric
  • Returns your dataset with the best preprocessing method applied

Hyperparameters

  • X_train : Your training feature set

  • X_val : Your validation feature set

  • y_train : Your training target values

  • y_val : Your validation target values

  • features : Features that contain outliers

    Note: This should NOT include all features in your dataset, only those suspected of containing outliers.

  • base_model : The model used to evaluate the performance of each preprocessing method.

  • metric : The evaluation metric used to compare performance.

  • higher_is_better :

    • True for metrics where higher values are better (e.g. accuracy_score, f1_score)
    • False for metrics where lower values are better (e.g. mean_squared_error)

Author

Author

This project is developed and maintained by MurtazaA2010.

For any questions or support: Email : murtazaabdullah989@gmail.com Web : Murtaza Abdullah

Installation

pip install AnLOF

```python
from AnLOF.AnLOF_module import AnLOF
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error

anlof = AnLOF(
    X_train,
    X_val,
    y_train,
    y_val,
    features=["feature1", "feature2"],  # features containing outliers
    base_model=LinearRegression,
    metric=mean_squared_error,
    higher_is_better=False
)

best_X_train, best_X_val, best_method, performance_df = anlof.forward()

# best_method : the method with the best score
# performance_df : contains the performance of all the methods

print("Best method:", best_method)

print("Best X_train:")
print(best_X_train.head())

print("Best X_val:")
print(best_X_val.head())

print("Performance comparison:")
print(performance_df)

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

anlof-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

anlof-1.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file anlof-1.0.1.tar.gz.

File metadata

  • Download URL: anlof-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for anlof-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6ddc1929271051a4d1ed2c6736eb1e540c880b11f72f301abf194aad180d56fb
MD5 565f1b5684c2ceb6a302b0de607c77cb
BLAKE2b-256 cec53f96508559d661a88f40daae3026d1a47d11807ad757cd1484bee46edfd0

See more details on using hashes here.

File details

Details for the file anlof-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: anlof-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for anlof-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a2a7b2eda104d76c2ce8c8bac489d7e738fd6b7cf07dfb5d595a5b51f3cb000
MD5 f66f4b4dc2cd3e4608c3cec7401435f0
BLAKE2b-256 857ce2e44a34e22836524c2d0de83f72a69749569144b8079a7770480f338b59

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