Skip to content

mrbmahdavi/Simple-linear-regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple-linear-regression

Simple Linear Regression Project: Predicting salaries based on years of experience

Overview

This project demonstrates a simple linear regression implementation. The model predicts salary based on years of experience using a dataset of salary information.

Project Structure

The notebook contains the following sections:

  1. Importing Libraries: Utilizes NumPy, Matplotlib, and Pandas for data manipulation and visualization.
  2. Importing Dataset: Loads the 'Salary_Data.csv' dataset.
  3. Splitting Dataset: Divides the data into training and test sets.
  4. Training the Model: Implements a simple linear regression model using Scikit-learn.
  5. Making Predictions: Uses the trained model to predict salaries on the test set.
  6. Visualization:
    • Training set results visualization
    • Test set results visualization

Key Features

  • Preparing dataset for linear regression
  • Clean implementation of linear regression
  • Data visualization using Matplotlib
  • Model evaluation on test data
  • Comparison of training vs test results

Dataset

The project uses 'Salary_Data.csv' which contains:

  • Years of Experience (independent variable)
  • Salary (dependent variable)

How to Use

  1. Open the notebook in Google Colab or Jupyter Notebook
  2. Ensure the 'Salary_Data.csv' file is in the same directory
  3. Run all cells sequentially
  4. Observe the regression line fitting and predictions

Results

The model shows the relationship between years of experience and salary, with visualizations demonstrating how well the linear regression line fits both training and test data.

License

This project is open source and available under the MIT License.

About

Simple Linear Regression Project: Predicting salaries based on years of experience

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published