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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
NewerOlder