# Feature-engine [](http://feature-engine.readthedocs.io) | | | | --- | --- | | **Open Source** | [](https://github.com/feature-engine/feature_engine/blob/master/LICENSE.md) [](https://www.trainindata.com/) [](https://jb.gg/OpenSource)| | **Tutorials** | [](https://www.youtube.com/watch?v=nisuJQTyDSA&list=PL_7uaHXkQmKVXh06fCWRxdQRZsl3wva5k) | | **Code** | [](https://pypi.org/project/feature-engine/) [](https://pypi.org/project/feature-engine) [](https://anaconda.org/conda-forge/feature_engine) | | **Downloads** | [](https://img.shields.io/pypi/dm/feature-engine) [)](https://pepy.tech/project/feature-engine)| | **Meta** | [](https://github.com/feature-engine/feature_engine/graphs/contributors) [](https://www.firsttimersonly.com/) | | **Documentation** | [](https://feature-engine.readthedocs.io/en/latest/index.html) | | **Citation** | [](https://zenodo.org/badge/latestdoi/163630824) [](https://doi.org/10.21105/joss.03642) | | **Testing** | [](https://app.circleci.com/pipelines/github/feature-engine/feature_engine) [](https://codecov.io/github/feature-engine/feature_engine) [](https://github.com/psf/black) |
## Feature-engine features in the following resources
* [Feature Engineering for Machine Learning, Online Course](https://www.trainindata.com/p/feature-engineering-for-machine-learning)
* [Feature Selection for Machine Learning, Online Course](https://www.trainindata.com/p/feature-selection-for-machine-learning)
* [Feature Engineering for Time Series Forecasting, Online Course](https://www.trainindata.com/p/feature-engineering-for-forecasting)
* [Forecasting with Machine Learning, Online Course](https://www.trainindata.com/p/forecasting-with-machine-learning)
* [Python Feature Engineering Cookbook](https://www.packtpub.com/en-us/product/python-feature-engineering-cookbook-9781835883587)
* [Feature Selection in Machine Learning Book](https://www.trainindata.com/p/feature-selection-in-machine-learning-book)
## Blogs about Feature-engine
* [Feature-engine: A new open-source Python package for feature engineering](https://trainindata.medium.com/feature-engine-a-new-open-source-python-package-for-feature-engineering-29a0ab88ea7c)
* [Practical Code Implementations of Feature Engineering for Machine Learning with Python](https://towardsdatascience.com/practical-code-implementations-of-feature-engineering-for-machine-learning-with-python-f13b953d4bcd)
## Documentation
* [Documentation](https://feature-engine.trainindata.com)
## Pst! How did you find us?
We want to share Feature-engine with more people. It'd help us loads if you tell us
how you discovered us.
Then we'd know what we are doing right and which channels to use to share the love.
Please share your story by answering 1 quick question
[at this link](https://docs.google.com/forms/d/e/1FAIpQLSfxvgnJvuvPf2XgosakhXo5VNQafqRrjNXkoW5qDWqnuxZNSQ/viewform?usp=sf_link)
. 😃
## Current Feature-engine's transformers include functionality for:
* Missing Data Imputation
* Categorical Encoding
* Discretisation
* Outlier Capping or Removal
* Variable Transformation
* Variable Creation
* Variable Selection
* Datetime Features
* Text Features
* Time Series
* Preprocessing
* Scaling
* Scikit-learn Wrappers
### Imputation Methods
* MeanMedianImputer
* ArbitraryNumberImputer
* RandomSampleImputer
* EndTailImputer
* CategoricalImputer
* AddMissingIndicator
* DropMissingData
### Encoding Methods
* OneHotEncoder
* OrdinalEncoder
* CountFrequencyEncoder
* MeanEncoder
* WoEEncoder
* RareLabelEncoder
* DecisionTreeEncoder
* StringSimilarityEncoder
### Discretisation methods
* EqualFrequencyDiscretiser
* EqualWidthDiscretiser
* GeometricWidthDiscretiser
* DecisionTreeDiscretiser
* ArbitraryDiscreriser
### Outlier Handling methods
* Winsorizer
* ArbitraryOutlierCapper
* OutlierTrimmer
### Variable Transformation methods
* LogTransformer
* LogCpTransformer
* ReciprocalTransformer
* ArcsinTransformer
* PowerTransformer
* BoxCoxTransformer
* YeoJohnsonTransformer
* ArcSinhTransformer
### Variable Scaling methods
* MeanNormalizationScaler
### Variable Creation:
* MathFeatures
* RelativeFeatures
* CyclicalFeatures
* DecisionTreeFeatures
* GeoDistanceFeatures
### Feature Selection:
* DropFeatures
* DropConstantFeatures
* DropDuplicateFeatures
* DropCorrelatedFeatures
* SmartCorrelationSelection
* ShuffleFeaturesSelector
* SelectBySingleFeaturePerformance
* SelectByTargetMeanPerformance
* RecursiveFeatureElimination
* RecursiveFeatureAddition
* DropHighPSIFeatures
* SelectByInformationValue
* ProbeFeatureSelection
* MRMR
### Datetime
* DatetimeFeatures
* DatetimeSubtraction
* DatetimeOrdinal
### Text Features
* TextFeatures
### Time Series
* LagFeatures
* WindowFeatures
* ExpandingWindowFeatures
### Pipelines
* Pipeline
* make_pipeline
### Preprocessing
* MatchCategories
* MatchVariables
### Wrappers:
* SklearnTransformerWrapper
## Installation
From PyPI using pip:
```
pip install feature_engine
```
From Anaconda:
```
conda install -c conda-forge feature_engine
```
Or simply clone it:
```
git clone https://github.com/feature-engine/feature_engine.git
```
## Example Usage
```python
>>> import pandas as pd
>>> from feature_engine.encoding import RareLabelEncoder
>>> data = {'var_A': ['A'] * 10 + ['B'] * 10 + ['C'] * 2 + ['D'] * 1}
>>> data = pd.DataFrame(data)
>>> data['var_A'].value_counts()
```
```
Out[1]:
A 10
B 10
C 2
D 1
Name: var_A, dtype: int64
```
```python
>>> rare_encoder = RareLabelEncoder(tol=0.10, n_categories=3)
>>> data_encoded = rare_encoder.fit_transform(data)
>>> data_encoded['var_A'].value_counts()
```
```
Out[2]:
A 10
B 10
Rare 3
Name: var_A, dtype: int64
```
Find more examples in our [Jupyter Notebook Gallery](https://nbviewer.org/github/feature-engine/feature-engine-examples/tree/main/)
or in the [documentation](https://feature-engine.trainindata.com).
## Contribute
Details about how to contribute can be found in the [Contribute Page](https://feature-engine.trainindata.com/en/latest/contribute/index.html)
Briefly:
- Fork the repo
- Clone your fork into your local computer:
```
git clone https://github.com/