Skip to content

Instantly share code, notes, and snippets.

View aryan-jadon's full-sized avatar
😀

Aryan Jadon aryan-jadon

😀
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aryan-jadon
aryan-jadon / Part-3.ipynb
Created September 16, 2022 02:19
Part-3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aryan-jadon
aryan-jadon / Part-2.ipynb
Created September 16, 2022 02:12
Part-2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aryan-jadon
aryan-jadon / Part-1.ipynb
Created September 16, 2022 02:12
Part-1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aryan-jadon
aryan-jadon / metrics.py
Created September 15, 2022 06:54
metrics.py
from sklearn import metrics
# Measure RMSE error. RMSE is common for regression.
pred = model(x_test)
score = torch.sqrt(torch.nn.functional.mse_loss(pred.flatten(),y_test))
print(f"Final score (RMSE): {score}")
## Final score (RMSE): 3.3968639373779297
@aryan-jadon
aryan-jadon / regression.py
Created September 15, 2022 06:52
regression.py
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
from sklearn import preprocessing
from torch.utils.data import DataLoader, TensorDataset
@aryan-jadon
aryan-jadon / loss.py
Created September 15, 2022 06:50
loss.py
from sklearn.metrics import accuracy_score
pred = model(x_test)
vloss = loss_fn(pred, y_test)
print(f"Loss = {vloss}")
## Loss = 0.5756629109382629
pred = model(x_test)
_, predict_classes = torch.max(pred, 1)