Code Monkey home page Code Monkey logo

pdfeaturegen's Introduction

Pandas Feature Generator

Supporting functions to generate features in Pandas Dataframe for Machine Learning

Installation

pip install pdfeaturegen

Usage example

import pdfeaturegen as pdfg
df = pd.read_csv('data/human_daily_pattern.csv')
df.head()
"""
|   | time                       | count               |
|---|----------------------------|---------------------|
| 0 | 2018-03-26 12:39:55.481733 | 121.35529262690343  |
| 1 | 2018-03-26 17:17:23.911690 | 0.3647851407453441  |
| 2 | 2018-03-26 09:56:38.268554 | 0.07366381105375536 |
| 3 | 2018-03-26 20:35:51.533865 | 0.28542161371348845 |
| 4 | 2018-03-26 17:22:16.504024 | 13.302750810079269  |
"""

df = pdfg.timestamp_feature_engineering_with_df(df, df.time)
df.head()
"""
|   | time                       | count               | time_year | time_month | time_day | time_hour | time_minute | time_second | time_week | time_weekday_name | time_weekofyear | time_quarter | time_is_leap_year | time_is_month_end | time_is_month_start | time_is_quarter_end | time_is_quarter_start | time_is_year_end | time_is_year_start |
|---|----------------------------|---------------------|-----------|------------|----------|-----------|-------------|-------------|-----------|-------------------|-----------------|--------------|-------------------|-------------------|---------------------|---------------------|-----------------------|------------------|--------------------|
| 0 | 2018-03-26 12:39:55.481733 | 121.35529262690343  | 2018      | 3          | 26       | 12        | 39          | 55          | 13        | Monday            | 13              | 1            | False             | False             | False               | False               | False                 | False            | False              |
| 1 | 2018-03-26 17:17:23.911690 | 0.3647851407453441  | 2018      | 3          | 26       | 17        | 17          | 23          | 13        | Monday            | 13              | 1            | False             | False             | False               | False               | False                 | False            | False              |
| 2 | 2018-03-26 09:56:38.268554 | 0.07366381105375536 | 2018      | 3          | 26       | 9         | 56          | 38          | 13        | Monday            | 13              | 1            | False             | False             | False               | False               | False                 | False            | False              |
| 3 | 2018-03-26 20:35:51.533865 | 0.28542161371348845 | 2018      | 3          | 26       | 20        | 35          | 51          | 13        | Monday            | 13              | 1            | False             | False             | False               | False               | False                 | False            | False              |
| 4 | 2018-03-26 17:22:16.504024 | 13.302750810079269  | 2018      | 3          | 26       | 17        | 22          | 16          | 13        | Monday            | 13              | 1            | False             | False             | False               | False               | False                 | False            | False              |
"""

Release History

  • 0.0.1
    • Work in progress

Meta

Ivan Foong โ€“ @vonze21 โ€“ [email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/ivanfoong/pdfeaturegen

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

pdfeaturegen's People

Contributors

ivanfoong avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.