Skip to content

MoAlkhateeb/torch-linear-regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salary Prediction Model

This project implements a simple linear regression model using PyTorch to predict salaries based on years of experience. This is a learning project.

Project Description

This beginner-friendly AI project demonstrates the following:

  • Loading and preprocessing data using NumPy and sklearn
  • Building a linear regression model with PyTorch
  • Training the model using gradient descent
  • Visualizing the results with Matplotlib

Dependencies

Install the dependencies using pipenv:

pipenv install

Dataset

The project uses a dataset named "Salary_dataset.csv". Ensure this file is located in a "datasets" folder in the same directory as the script.

Results

The script will output:

  • The training progress, showing the loss for each epoch
  • A plot of the training loss over time
  • A scatter plot of the original data with the fitted regression line
  • The final model parameters (weight and bias)

About

Simple Linear Regression using PyTorch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published