Learn practical skills, build real-world projects, and advance your career

Linear Regression

Herein are implementations of models that solve linear regression (or it's more specific form; logistic regression) problems.

Data Sets

Various Data sets will be used

Hyperparameters

I explore the effects of certain hyperparameters on the model's learning process.
The hyperparameters that I'll examine are:

  • learning rate
  • number of epochs
  • training set size
  • validation set size
!conda install pytorch -y
Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.8.2 latest version: 4.8.3 Please update conda by running $ conda update -n base conda ## Package Plan ## environment location: /srv/conda/envs/notebook added / updated specs: - pytorch The following packages will be downloaded: package | build ---------------------------|----------------- _pytorch_select-0.2 | gpu_0 2 KB defaults blas-1.0 | mkl 6 KB defaults ca-certificates-2020.4.5.1 | hecc5488_0 146 KB conda-forge certifi-2020.4.5.1 | py37hc8dfbb8_0 151 KB conda-forge cudatoolkit-10.1.243 | h6bb024c_0 347.4 MB defaults cudnn-7.6.5 | cuda10.1_0 179.9 MB defaults intel-openmp-2020.1 | 217 780 KB defaults libgfortran-ng-7.5.0 | hdf63c60_6 1.7 MB conda-forge mkl-2020.1 | 217 129.0 MB defaults mkl-service-2.3.0 | py37he904b0f_0 218 KB defaults mkl_fft-1.0.15 | py37ha843d7b_0 154 KB defaults mkl_random-1.1.1 | py37h0da4684_0 366 KB conda-forge ninja-1.10.0 | hc9558a2_0 1.9 MB conda-forge numpy-1.18.1 | py37h4f9e942_0 5 KB defaults numpy-base-1.18.1 | py37hde5b4d6_1 4.2 MB defaults openssl-1.1.1g | h516909a_0 2.1 MB conda-forge pytorch-1.4.0 |cuda101py37h02f0884_0 167.4 MB defaults ------------------------------------------------------------ Total: 835.4 MB The following NEW packages will be INSTALLED: _pytorch_select pkgs/main/linux-64::_pytorch_select-0.2-gpu_0 blas pkgs/main/linux-64::blas-1.0-mkl cudatoolkit pkgs/main/linux-64::cudatoolkit-10.1.243-h6bb024c_0 cudnn pkgs/main/linux-64::cudnn-7.6.5-cuda10.1_0 intel-openmp pkgs/main/linux-64::intel-openmp-2020.1-217 libgfortran-ng conda-forge/linux-64::libgfortran-ng-7.5.0-hdf63c60_6 mkl pkgs/main/linux-64::mkl-2020.1-217 mkl-service pkgs/main/linux-64::mkl-service-2.3.0-py37he904b0f_0 mkl_fft pkgs/main/linux-64::mkl_fft-1.0.15-py37ha843d7b_0 mkl_random conda-forge/linux-64::mkl_random-1.1.1-py37h0da4684_0 ninja conda-forge/linux-64::ninja-1.10.0-hc9558a2_0 numpy pkgs/main/linux-64::numpy-1.18.1-py37h4f9e942_0 numpy-base pkgs/main/linux-64::numpy-base-1.18.1-py37hde5b4d6_1 pytorch pkgs/main/linux-64::pytorch-1.4.0-cuda101py37h02f0884_0 The following packages will be UPDATED: ca-certificates 2019.11.28-hecc5488_0 --> 2020.4.5.1-hecc5488_0 certifi 2019.11.28-py37hc8dfbb8_1 --> 2020.4.5.1-py37hc8dfbb8_0 openssl 1.1.1d-h516909a_0 --> 1.1.1g-h516909a_0 Downloading and Extracting Packages ca-certificates-2020 | 146 KB | ##################################### | 100% blas-1.0 | 6 KB | ##################################### | 100% mkl_fft-1.0.15 | 154 KB | ##################################### | 100% numpy-base-1.18.1 | 4.2 MB | ##################################### | 100% mkl_random-1.1.1 | 366 KB | ##################################### | 100% _pytorch_select-0.2 | 2 KB | ##################################### | 100% numpy-1.18.1 | 5 KB | ##################################### | 100% certifi-2020.4.5.1 | 151 KB | ##################################### | 100% intel-openmp-2020.1 | 780 KB | ##################################### | 100% mkl-2020.1 | 129.0 MB | ##################################### | 100% pytorch-1.4.0 | 167.4 MB | ##################################### | 100% cudnn-7.6.5 | 179.9 MB | ##################################### | 100% cudatoolkit-10.1.243 | 347.4 MB | ##################################### | 100% openssl-1.1.1g | 2.1 MB | ##################################### | 100% mkl-service-2.3.0 | 218 KB | ##################################### | 100% ninja-1.10.0 | 1.9 MB | ##################################### | 100% libgfortran-ng-7.5.0 | 1.7 MB | ##################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done
import torch
import csv
with open('dataset.csv') as input_file:
    reader = csv.DictReader(input_file)


for row in reader:
    
import jovian
jovian.commit()
[jovian] Attempting to save notebook..