Skip to content

Instantly share code, notes, and snippets.

@analyticsindiamagazine
Created January 13, 2020 07:57
Show Gist options
  • Save analyticsindiamagazine/e370bee436029c8753cc43a30acabff3 to your computer and use it in GitHub Desktop.
Save analyticsindiamagazine/e370bee436029c8753cc43a30acabff3 to your computer and use it in GitHub Desktop.
Template for Feature_Pipeline.py
# -*- coding: utf-8 -*-
""" This is the expected File Format for Feature_pipeline.py script """
## import required libraries
import time
import pandas as pd
import os
# load the training set - Do not edit this line
train_transaction_df = pd.read_csv("train_data.csv") #The train dataset name an path should remail unchanged train_data.csv- Do not edit this line
# append the train label.
#load the test set- Do not edit this line
test_transaction_df = pd.read_csv("test_data.csv") #The test dataset name an path should remail unchanged train_data.csv- Do not edit this line
# define functions for recency calculation
def create_recency_features():
""" add the function body """
pass
# define functions for frequency calculation.
def create_frequency_features():
""" add the function body """
pass
# define functions for normchange calculation.
def create_normchange_features():
""" add the function body """
pass
if __name__ == '__main__':
create_recency_features()
create_frequency_features()
create_normchange_features()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment