This program is written based on Python, simply run part1_nn_lib.py
and part2_house_value_regression.py
directly to start the script of Part 1 & Part 2 respectively.
Part 1 of the coursework where we implemented a mini-library of the neural network. Check this file for imformation about
- MSELossLayer
- CrossEntropyLossLayer
- SigmoidLayer
- ReluLayer
- LinearLayer
- MultiLayerNetwork
- Trainer
- _init_()
- forward()
- backward()
- update_params()
- shuffle()
- ...
Part 2 of the coursework where we created and trained a neural network for regression. Check this file for imformation about
- LinearRegressorModel
- Regressor
- _init_()
- _preprocessor()
- fit()
- predict()
- score()
- RegressorHyperParameterSearch()
- ...
- Implemented in
part1_nn_lib.py
- In class LinearLayer:
- _init_(): Constructor
- forward(): Forward pass method
- backward(): Backward pass method
- update_params(): Parameter update method
- In class SigmoidLayer and ReluLayer:
- forward(): Forward pass method
- backward(): Backward pass method
- In class MultiLayerNetwork:
- _init_(): Constructor
- forward(): Forward pass method
- backward(): Backward pass method
- update_params(): Parameter update method
- In class Trainer:
- _init_(): Constructor
- shuffle(): Data shuffling
- train(): Main training loop
- eval_loss(): Computing evaluation loss
- In class Preprocessor:
- _init_(): Constructor
- apply(): Apply method
- revert(): Revert method
- In this part we aim to infer the median house value from all other attributes in a given dataset.
- The dataset
housing.csv
is given, it covers all the block groups in California from the 1990 Census, contains 20,640 observations on ten variables:
- longitude: longitude of the block group
- latitude: latitude of the block group
- housing median age: median age of the individuals living in the block group
- total rooms: total number of rooms in the block group
- total bedrooms: total number of bedrooms in the block group
- population: total population of the block group
- households: number of households in the block group
- median income: median income of the households comprise in the block group
- ocean proximity: proximity to the ocean of the block group
- median house value: median value of the houses of the block group
- _preprocessor(): Preprocessor method
- _init_(): Constructor method
- fit(): Model-training method
- predict(): Prediction method
- score(): Evaluation method
- RegressorHyperParameterSearch(): Perform a hyperparameter search
- The final report of this coursework has been located in
\report
directory, it containsintro_to_ML_cw2_report_final.pdf
and its LaTeX file compressed within zip.