Package: feature-engine
Feature EngineFeature-engine is a Python library with multiple transformers to engineer and select features for use in machine learning models.
Feature-engine's transformers follow Scikit-learn's functionality with fit() and transform() methods to learn the
transforming parameters from the data and then transform it.Feature-engine features in the following resourcesFeature Engineering for Machine Learning, Online CourseFeature Selection for Machine Learning, Online CourseFeature Engineering for Time Series Forecasting, Online CoursePython Feature Engineering CookbookFeature Selection in Machine Learning with Python BookBlogs about Feature-engineFeature-engine: A new open-source Python package for feature engineeringPractical Code Implementations of Feature Engineering for Machine Learning with PythonDocumentationDocumentationCurrent Feature-engine's transformers include functionality for:Missing Data ImputationCategorical EncodingDiscretisationOutlier Capping or RemovalVariable TransformationVariable CreationVariable SelectionDatetime FeaturesTime SeriesPreprocessingScikit-learn WrappersImputation MethodsMeanMedianImputerRandomSampleImputerEndTailImputerAddMissingIndicatorCategoricalImputerArbitraryNumberImputerDropMissingDataEncoding MethodsOneHotEncoderOrdinalEncoderCountFrequencyEncoderMeanEncoderWoEEncoderRareLabelEncoderDecisionTreeEncoderStringSimilarityEncoderDiscretisation methodsEqualFrequencyDiscretiserEqualWidthDiscretiserGeometricWidthDiscretiserDecisionTreeDiscretiserArbitraryDiscreriserOutlier Handling methodsWinsorizerArbitraryOutlierCapperOutlierTrimmerVariable Transformation methodsLogTransformerLogCpTransformerReciprocalTransformerArcsinTransformerPowerTransformerBoxCoxTransformerYeoJohnsonTransformerVariable Creation:MathFeaturesRelativeFeaturesCyclicalFeaturesFeature Selection:DropFeaturesDropConstantFeaturesDropDuplicateFeaturesDropCorrelatedFeaturesSmartCorrelationSelectionShuffleFeaturesSelectorSelectBySingleFeaturePerformanceSelectByTargetMeanPerformanceRecursiveFeatureEliminationRecursiveFeatureAdditionDropHighPSIFeaturesSelectByInformationValueProbeFeatureSelectionDatetimeDatetimeFeaturesDatetimeSubtractionTime SeriesLagFeaturesWindowFeaturesExpandingWindowFeaturesPreprocessingMatchCategoriesMatchVariablesWrappers:SklearnTransformerWrapperInstallationFrom PyPI using pip:pip install feature_engineFrom Anaconda:conda install -c conda-forge feature_engineOr simply clone it:git clone https://github.com/feature-engine/feature_engine.gitExample Usage>>>importpandasaspd>>>fromfeature_engine.encodingimportRareLabelEncoder>>>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>>>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: int64Find more examples in ourJupyter Notebook Galleryor in thedocumentation.ContributeDetails about how to contribute can be found in theContribute PageBriefly:Fork the repoClone your fork into your local computer:git clone https://github.com/<YOURUSERNAME>/feature_engine.gitnavigate into the repo foldercd feature_engineInstall Feature-engine as a developer:pip install -e .Optional: Create and activate a virtual environment with any tool of choiceInstall Feature-engine dependencies:pip install -r requirements.txtandpip install -r test_requirements.txtCreate a feature branch with a meaningful name for your feature:git checkout -b myfeaturebranchDevelop your feature, tests and documentationMake sure the tests passMake a PRThank you!!DocumentationFeature-engine documentation is built usingSphinxand is hosted onRead the Docs.To build the documentation make sure you have the dependencies installed: from the root directory:pip install -r docs/requirements.txt.Now you can build the docs using:sphinx-build -b html docs buildLicenseThe content of this repository is licensed under aBSD 3-Clause license.Sponsor usSponsor usand support further our
mission to democratize machine learning and programming tools through open-source
software.