{"id":19637065,"url":"https://github.com/caiocarneloz/fastfe","last_synced_at":"2026-05-11T12:32:09.367Z","repository":{"id":201485579,"uuid":"184671274","full_name":"caiocarneloz/fastfe","owner":"caiocarneloz","description":"Simple feature engineering for baseline purposes","archived":false,"fork":false,"pushed_at":"2019-07-10T18:56:56.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T17:01:55.991Z","etag":null,"topics":["data-science","feature-engineering","machine-learning","pandas"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caiocarneloz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-02T23:41:20.000Z","updated_at":"2021-03-23T21:04:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"9af06f8a-0780-455f-8fd4-d42fba375085","html_url":"https://github.com/caiocarneloz/fastfe","commit_stats":null,"previous_names":["caiocarneloz/fastfe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiocarneloz%2Ffastfe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiocarneloz%2Ffastfe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiocarneloz%2Ffastfe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caiocarneloz%2Ffastfe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caiocarneloz","download_url":"https://codeload.github.com/caiocarneloz/fastfe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240941505,"owners_count":19882062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","feature-engineering","machine-learning","pandas"],"created_at":"2024-11-11T12:33:02.351Z","updated_at":"2026-05-11T12:32:04.341Z","avatar_url":"https://github.com/caiocarneloz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastfe\r\nFast feature engineering with simple operations using pandas for baseline purposes\r\n\r\n## Getting Started\r\n#### Dependencies\r\nYou need Python 3.5 or later to use **fastfe**. You can find it at [python.org](https://www.python.org/).\r\n\r\nYou aso need the pandas package, which is available from [PyPI](https://pypi.org). If you have pip, just run:\r\n```\r\npip install pandas\r\n```\r\n#### Installation\r\nClone this repo to your local machine using:\r\n```\r\ngit clone https://github.com/caiocarneloz/fastfe.git\r\n```\r\n\r\n## Features\r\n- Get list of columns by specific data type\r\n- Do arithmetic operations with columns\r\n- Get abs difference between columns\r\n- Onehot encode columns\r\n- Normalize columns\r\n\r\n## Usage\r\nThe **fastfe** function takes as argument a dataframe containing the data and a dictionary containing the desired output. The desired outputs are the dictionary keys while column names are the values. The possible outputs are represented by the following keys:\r\n\r\n- **sum** - to get the sum of a set of columns\r\n- **diff** - to get the difference between columns\r\n- **quo** - to get de quotient between columns\r\n- **prod** - to get the product between columns\r\n- **abs_diff** - to get the abs difference between columns\r\n- **onehot** - to onehot encode a set of columns\r\n- **norm** - to normalize a set of columns\r\n~~- **date_eng** - to create features from dates~~\r\n\r\nArithmetic operations expects a list of lists, while onehot encoding and normalization expects a list.\r\n\r\n## Example\r\nWith the following dummy dataset:\r\n```\r\n   column_1  column_2  column_3 column_4   column_5  column_6  column_7\r\n0      8.76      2.98      3.30    type1  category2      5.90      7.67\r\n1      3.56      3.89      8.75    type2  category2      6.48      2.08\r\n2      2.76      6.75      2.73    type1  category1      3.07      1.72\r\n3      6.89      7.03      4.72    type1  category2      3.97      9.28\r\n4      5.46      6.45      4.37    type1  category1      9.07      7.74\r\n5      1.18      4.72      2.18    type2  category1      8.13      2.85\r\n6      3.30      0.30      6.65    type2  category2      3.11      3.67\r\n7      8.10      0.58      9.36    type1  category1      3.19      0.22\r\n8      3.73      6.83      4.27    type2  category2      9.88      4.01\r\n9      5.65      8.01      0.31    type1  category1      7.83      2.89\r\n```\r\nwe gonna create a dictionary to get:\r\n- a column with the difference between column_1 and column_2\r\n- columns with the sum of column_1 and column_2, and column_1, column_2 and column_3\r\n- columns representing the onehot encoding of column_4 and column_5\r\n- columns with column_6 and column_7 normalized\r\n\r\n```python\r\nop_dict = {}\r\nop_dict['diff'] = [['column_1', 'column2']]\r\nop_dict['sum'] = [['column_1', 'column_2'], ['column_1', 'column2', 'column_3']]\r\nop_dict['onehot'] = ['column_4', 'column_5']\r\nop_dict['norm'] = ['column_6', 'column_7']\r\n```\r\nas output, the function returns the dataframe and a dictionary with the index for the new columns:\r\n```\r\ndf, features_dict = fastfe(df, op_dict)\r\n```\r\ndf:\r\n```\r\n   column_1  column_2      ...       norm_column_6 norm_column_7\r\n0      8.76      2.98      ...            3.580997      6.263216\r\n1      3.56      3.89      ...            4.160997      0.673216\r\n2      2.76      6.75      ...            0.750997      0.313216\r\n3      6.89      7.03      ...            1.650997      7.873216\r\n4      5.46      6.45      ...            6.750997      6.333216\r\n5      1.18      4.72      ...            5.810997      1.443216\r\n6      3.30      0.30      ...            0.790997      2.263216\r\n7      8.10      0.58      ...            0.870997     -1.186784\r\n8      3.73      6.83      ...            7.560997      2.603216\r\n9      5.65      8.01      ...            5.510997      1.483216\r\n```\r\nfeatures_dict:\r\n```\r\n{'arithmetic': \r\n['sum_column_1_column_2',\r\n'sum_column_1_column_2_column_3',\r\n'diff_column_1_column_2'],\r\n\r\n 'onehot': \r\n ['column_4_type1',\r\n 'column_4_type2',\r\n 'column_5_category1',\r\n 'column_5_category2'],\r\n \r\n 'normalized': \r\n ['norm_column_6', \r\n 'norm_column_7']}\r\n```\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaiocarneloz%2Ffastfe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaiocarneloz%2Ffastfe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaiocarneloz%2Ffastfe/lists"}