Package: autofeat
autofeatlibraryLinear Prediction Models with Automated Feature Engineering and SelectionThis library contains theAutoFeatRegressorandAutoFeatClassifiermodels with a similar interface asscikit-learnmodels:fit()function to fit the model parameterspredict()function to predict the target variable given the inputpredict_proba()function to predict probabilities of the target variable given the input (classifier only)score()function to calculate the goodness of the fit (R^2/accuracy)fit_transform()andtransform()functions, which extend the given data by the additional features that were engineered and selected by the modelWhen calling thefit()function, internally thefit_transform()function will be called, so if you're planing to calltransform()on the same data anyways, just callfit_transform()right away.transform()is mostly useful if you've split your data into training and test data and did not callfit_transform()on your whole dataset. Thepredict()andscore()functions can either be given data in the format of the original dataframe that was used when callingfit()/fit_transform()or they can be given an already transformed dataframe.In addition, only the feature selection part is also available in theFeatureSelectormodel.Furthermore (as of version 2.0.0), minimal feature selection (removing zero variance and redundant features), engineering (simple product and ratio of features), and scaling (power transform to make features more normally distributed) is also available in theAutoFeatLightmodel.TheAutoFeatRegressor,AutoFeatClassifier, andFeatureSelectormodels need to befit on data without NaNs, as they internally call the sklearnLassoLarsCVmodel, which can not handle NaNs. When callingtransform(), NaNs (but notnp.inf) are okay.Theautofeat examples notebookcontains a simple usage example - try it out! :) Additional examples can be found in the autofeat benchmark notebooks forregression(which also contains the code to reproduce the results from the paper mentioned below) andclassification, as well as the testing scripts.Please keep in mind that since theAutoFeatRegressorandAutoFeatClassifiermodels can generate very complex features, they mightoverfit on noisein the dataset, i.e., find some new features that lead to good prediction on the training set but result in a poor performance on new test samples. While this usually only happens for datasets with very few samples, we suggest you carefully inspect the features found byautofeatand use those that make sense to you to train your own models.Depending on the number offeateng_steps(default 2) and the number of input features,autofeatcan generate a very huge feature matrix (before selecting the most appropriate features from this large feature pool). By specifying infeateng_colsthose columns that you expect to be most valuable in the feature engineering part, the number of features can be greatly reduced. Additionally,transformationscan be limited to only those feature transformations that make sense for your data. Last but not least, you can subsample the data used for training the model to limit the memory requirements. After the model was fit, you can calltransform()on your whole dataset to generate only those few features that were selected duringfit()/fit_transform().InstallationYou can either download the code from here and include the autofeat folder in your$PYTHONPATHor install (the library components only) via pip:$ pip install autofeatThe library requires Python 3! Other dependencies:numpy,pandas,scikit-learn,sympy,joblib,pintandnumba.PaperFor further details on the model and implementation please refer to thepaper- and of course if any of this code was helpful for your research, please consider citing it:@inproceedings{horn2019autofeat,
  title={The autofeat Python Library for Automated Feature Engineering and Selection},
  author={Horn, Franziska and Pack, Robert and Rieger, Michael},
  booktitle={Joint European Conference on Machine Learning and Knowledge Discovery in Databases},
  pages={111--120},
  year={2019},
  organization={Springer}
}If you don't like reading, you can also watch a video of mytalk at the PyData conferenceabout automated feature engineering and selection withautofeat.The code is intended for research purposes.If you have any questions please don't hesitate to send me anemailand of course if you should find any bugs or want to contribute other improvements, pull requests are very welcome!AcknowledgmentsThis project was made possible thanks to support byBASF.