Created
July 12, 2018 23:43
-
-
Save securetorobert/3b8a9a0436e8f51862863a266970c225 to your computer and use it in GitHub Desktop.
Neural Network with Keras on Boston Housing data
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
import pandas as pd | |
from sklearn.preprocessing import MinMaxScaler | |
import tensorflow as tf | |
#read in training data | |
train_df = pd.read_csv('train.csv', index_col='ID') | |
train_df.head() | |
target = 'medv' | |
scaler = MinMaxScaler(feature_range=(0, 1)) | |
scaled_train = scaler.fit_transform(train_df) | |
# Print out the adjustment that the scaler applied to the total_earnings column of data | |
print("Note: median values were scaled by multiplying by {:.10f} and adding {:.6f}".format(scaler.scale_[13], scaler.min_[13])) | |
multiplied_by = scaler.scale_[13] | |
added = scaler.min_[13] | |
scaled_train_df = pd.DataFrame(scaled_train, columns=train_df.columns.values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment