Sketching the Journey of Learning

Bali's notes & demos.

Chap 3: Capital Share Bikeshare Predictor: Follow the Book | Sketching the Journey of Learning

Chap 3: Capital Share Bikeshare Predictor: Follow the Book

May 05, 2022

Import

0_import

Data Preprocess

Load & View the data

1_view-data-1 1_view-data-2

make 1-hot & binary input features

check total number of classes to separate the binary and those has more than 2 classes. 2_check-classes

make the 1-hot features 3_dummy-fields-1 3_dummy-fields-2

include the binary features into the dataframe of input. 04_binary_features-1 04_binary_features-2

process the quantitative data

normalize the quantitative data. 05_quantitative

add them into the input & target dataframe. 05_quantitative 05_quantitative

make the input & target tensors

06_tensor-1 beware the values.reshape(len(df_tgt),1). For the output is only 1 dimensional, such reshape help avoid the warning of dimensional mismatch. 06_tensor-2

make dataset objects

07_dataset-obj

define & make model

08_define-model

make train & test function

09_train-test-fn-1 09_train-test-fn-1

Train & Test

Cycle 1 10_train-cycle1 10_train-cycle1 on train data, looks not good enough; 1 nore cycle.

Cycle 2 11_train-cycle2-1 11_train-cycle2-2 looks similar to cycle 1 on train data. check test data. 11_train-cycle2-3 11_train-cycle2-4 11_train-cycle2-5 fair performance.

Cycle 3, train more epoches. 12_train-cycle3-1 12_train-cycle3-2 performance on train data looks similar as before. 12_train-cycle3-3 12_train-cycle3-4 also similar on test data.