Metadata-Version: 2.4
Name: AnLOF
Version: 1.0.0
Summary: Automatic Outliers Handler Library
Author: Murtaza Abdullah
Project-URL: Homepage, https://github.com/MurtazaA2010/AnML
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: xgboost
Requires-Dist: catboost
Requires-Dist: lightgbm

#  AnLOF

**AnLOF** is a  machine learning utility library build to automatically handle outliers Effectively.

AnLOF uses multiple outliers handling tools and helps you automatically select the best-performing method.

The Ooutliers Handling Tools Used are:
- IQR Score
- Z-score
- Winsorization
- Median Scoring
- Mean Scoring
- Isolation Forest
- Boxcox Transformation
- k-Nearest Neighbors
- XGBRegression
- LGBMRegresion
- CatBoostRegression
- Standard Scaler
- Robust Scaler
- MinMax Scaler
- Log Transformation
- Quantile Normalization

---

##  Features

-  Automatic outlier detection & handling
-  Multiple preprocessing strategies
-  Model-based evaluation
-  Selects best method based on chosen metric
-  Get your dataset Ready with the best methods applied
---

---

## Hyperparameters


- X_train : Your training features set
- X_val : Your validation features set
- y_train : your training target set
- t_val : your validation target set
- features : Features that contains outliers. [Note : Not all the feautures of your dataset]
- base_model : The model based on which you want to evaluate the tools performance and select the best one
- metric : The evaluation metric you use
- higher_is_better : "YES" for metrics where hihger is better for example accuracy_score or f1_score "NO" otherwise.

## Author

This Project is developed and managed by MurtazaA2010. For any help email him at: murtazaabdullah989@gmail.com

##  Installation

```bash
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
## performace_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)
