Created
October 9, 2020 15:57
-
-
Save tiaplagata/9082274f6eb15000d9694f5b699ece20 to your computer and use it in GitHub Desktop.
Log Transformation of Target Feature in Linear Model
This file contains hidden or 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
# Our main dataframe is df | |
continuous = ['price', 'sqft_living', 'sqft_lot', 'sqft_living15', 'sqft_lot15'] | |
df_log = df[continuous] | |
# Create column names that indicate a log ex. 'price_log' | |
log_names = [f'{column}_log' for column in df_log.columns] | |
df_log = np.log10(df_log) | |
df_log.columns = log_names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment