Chap 3: Capital Share Bikeshare Predictor: Follow the Book
Import
Data Preprocess
Load & View the data
make 1-hot & binary input features
check total number of classes to separate the binary and those has more than 2 classes.
make the 1-hot features
include the binary features into the dataframe of input.
process the quantitative data
normalize the quantitative data.
add them into the input & target dataframe.
make the input & target tensors
beware the values.reshape(len(df_tgt),1)
. For the output is only 1 dimensional, such reshape help avoid the warning of dimensional mismatch.
make dataset objects
define & make model
make train & test function
Train & Test
Cycle 1 on train data, looks not good enough; 1 nore cycle.
Cycle 2 looks similar to cycle 1 on train data. check test data. fair performance.
Cycle 3, train more epoches. performance on train data looks similar as before. also similar on test data.