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

Pokemon Total Hit Linear Regression Model

This model uses pytorch to create a predictive model of the total amount of attack hit a pokemon can deal. The features of this model are the type, defense, whether its a legendary or not and similar.

Data Type

The data used was a text file (.csv) containing the characteristic of each pokemon. This is a database from Kaggle named Pokemon Stat.

Problem Statement
A linear regression model was used to predict the hit strenght of a pokemon based on its type, set hp, attack, defense, speed, generation, and whether it is a legendary or not

#importing the libraries to be used 
import torch
import torchvision
import torch.nn as nn
import pandas as pd
import seaborn as sns 
import matplotlib.pyplot as plt
import torch.nn.functional as F
from torchvision.datasets.utils import download_url
from torch.utils.data import DataLoader, TensorDataset, random_split
import warnings
warnings.filterwarnings('ignore')

Data Cleaning and Preparation

Importing the dataset

data_df = pd.read_csv('.../Pokemon.csv')
data_df

The total dataset size is 800 rows and 13 columns and columns that were not needed were dropped