Last active
August 1, 2020 13:40
-
-
Save IvanNardini/72cd5d2c96464e1f2ec4179b5104b1d3 to your computer and use it in GitHub Desktop.
Back to the Machine Learning fundamentals: How to write code for Model deployment (Part 3/3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encoder(data, var, mapping): | |
''' | |
Encode all variables for training | |
:params: data, var, mapping | |
:return: DataFrame | |
''' | |
if var not in data.columns.values.tolist(): | |
pass | |
return data[var].map(mapping) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment