Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Back to the Machine Learning fundamentals: How to write code for Model deployment (Part 3/3)
def train():
# Read Data
data = pd.read_csv(DATA_INGESTION['data_path'])
target = DATA_INGESTION['data_map']['target']
variables = DATA_INGESTION['data_map']['variables']
flt = data['umbrella_limit']>=0
data = data[flt]
data[target] = data[target].map(FEATURES_ENGINEERING['target_encoding'])
#Split data
X_train, X_test, y_train, y_test = train_test_split(data[variables], data[target],
#Train Pipeline
Pipeline_Fit =, y_train)
#Save Model, PIPE_TRAINING['pipe_path'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.