June 2019
Intermediate to advanced
308 pages
7h 21m
English
First, we scale the data to center to the mean. Then, we perform component-wise scaling to unit variance. This will help our model to converge the training more quickly:
featureDF = np.asarray(trainDF.iloc[:,0:520]) # First 520 features featureDF[featureDF == 100] = -110featureDF = (featureDF - featureDF.mean()) / featureDF.var()
Then, we construct the true labels. We convert all the building IDs and building floors to strings:
labelDF = np.asarray(trainDF["BUILDINGID"].map(str) + trainDF["FLOOR"].map(str)) labelDF = np.asarray(pd.get_dummies(labelDF))
Then, let's try to create two variables: train_x and train_y. This will help to avoid confusion during the training evaluation:
train_x = featureDFtrain_y = ...
Read now
Unlock full access