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

Relative Humidity prediction using linear regression (minimal)

Using the boston housing dataset: https://archive.ics.uci.edu/ml/datasets/Air+Quality

# Uncomment and run the commands below if imports fail
!conda install numpy pytorch torchvision cpuonly -c pytorch -y
!pip install matplotlib --upgrade --quiet
!pip install jovian --upgrade --quiet
Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /opt/conda added / updated specs: - cpuonly - numpy - pytorch - torchvision The following packages will be downloaded: package | build ---------------------------|----------------- ca-certificates-2020.4.5.2 | hecda079_0 147 KB conda-forge certifi-2020.4.5.2 | py37hc8dfbb8_0 152 KB conda-forge numpy-1.18.5 | py37h8960a57_0 5.1 MB conda-forge ------------------------------------------------------------ Total: 5.4 MB The following packages will be UPDATED: ca-certificates 2020.4.5.1-hecc5488_0 --> 2020.4.5.2-hecda079_0 certifi 2020.4.5.1-py37hc8dfbb8_0 --> 2020.4.5.2-py37hc8dfbb8_0 numpy 1.18.1-py37h8960a57_1 --> 1.18.5-py37h8960a57_0 Downloading and Extracting Packages certifi-2020.4.5.2 | 152 KB | ##################################### | 100% numpy-1.18.5 | 5.1 MB | ##################################### | 100% ca-certificates-2020 | 147 KB | ##################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done
# Imports
import torch
import jovian
import torchvision
import torch.nn as nn
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import torch.nn.functional as F
from datetime import *
from torchvision.datasets.utils import download_url
from torch.utils.data import DataLoader, TensorDataset, random_split

Read file

dataframe = pd.read_csv('../input/airquality-uci/AirQualityUCI.csv', delimiter =';', decimal= ',')
# here you have to use delimiter ';' which will make your raw data into tabular form with colums and rows
# decimal = ',' makes your column values seperated with dot rather than comma
dataframe.head()
# , parse_dates = [['Date', 'Time']]