Giter Site home page Giter Site logo

aliiimaher / laptop-price-prediction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.69 MB

This is an AI model for predicting laptop price, trained on about 1200 data.

License: MIT License

Python 75.53% Jupyter Notebook 24.47%
ai data-cleaning-and-preprocessing linear-algebra linear-regression price-prediction-model

laptop-price-prediction's Introduction

Laptop-Price-Prediction

This is an AI model for predicting laptop price, trained on about 1200 data.

Linear Algebra Project: Laptop Price Prediction

Prepared for

Dr. Mohammad Taheri

Prepared by

Ali Maher, Amir Hossein Ezzati

Date

13th of July 2024


Introduction

This project utilizes linear algebra concepts to analyze and predict laptop prices based on data extracted from the e-commerce website, Digikala. The process involves web scraping to collect relevant features such as price, rating, and reviews, followed by data transformation for use in a linear regression model. The model is trained and evaluated to predict laptop prices accurately.

Project Overview

  1. Data Collection & Data Cleaning

    • Web Scraping with Beautiful Soup: Initial attempts using Beautiful Soup faced issues due to Digikala’s anti-scraping measures.
    • Switching to Selenium: Selenium was used for more robust web scraping, overcoming challenges like intermediary screens and varied data formats.
    • Handling Data Formats: Conversion of Persian numerals and words to English, parsing mixed data formats, and separating combined values.
  2. Linear Regression Model

    • Data Splitting: Dataset split into training (80%) and testing (20%) sets.
    • Model Training: A linear regression model was trained on the training set.
    • Model Evaluation: Evaluated using metrics like Mean Squared Error (MSE) and R-squared score, achieving 94% accuracy.
  3. Price Prediction

    • GUI Development: A user-friendly GUI was created using Tkinter, incorporating features like dropdown menus and handling menu item indexing challenges.

Detailed Steps

Part 1: Data Collection & Data Cleaning

  • Initial Attempts with Beautiful Soup: Faced issues with decoy HTML content from Digikala.
  • Switching to Selenium: Automated browser interactions to bypass intermediary screens and access real HTML content.
  • Handling Diverse Data Formats: Parsing numerical values embedded in strings, converting Persian text to English, and dealing with mixed formats.
  • Language and Number Conversion: Translated Persian numerals and units to English equivalents.
  • Automating the Process: Developed a comprehensive script for efficient data extraction and conversion.

Challenges and Solutions:

  • Invalid Data in Columns: Replaced invalid entries like "متغیر" with acceptable values after research.
  • Internal Storage Column: Translated and separated combined SSD and HDD values.
  • Non-numerical Columns: Applied one-hot encoding to convert categorical data into numerical format.

Part 2: Linear Regression Model

  • Data Splitting: 80% of data used for training, 20% for testing.
  • Model Training: Trained a linear regression model on the cleaned dataset.
  • Model Evaluation: Achieved about 94% accuracy using MSE and R-squared metrics.

Part 3: Price Prediction

  • GUI Development with Tkinter: Created a GUI for price prediction.
  • Challenges in Tkinter: Resolved bugs related to dropdown menu item indexing by appending identifiers to avoid confusion.

Conclusion

This project demonstrates the practical application of linear algebra in predicting laptop prices. Key achievements include overcoming data scraping and cleaning challenges, effectively using one-hot encoding for categorical data, and developing a highly accurate linear regression model. The user-friendly GUI enhances usability, making the tool accessible for end-users.

gui_pic

Repository Contents

  • Data Collection Scripts: Selenium scripts for web scraping.
  • Data Cleaning Scripts: Python scripts for data cleaning and conversion.
  • Linear Regression Model: Model training and evaluation scripts.
  • GUI Application: Tkinter-based GUI for price prediction.
  • Documentation: Detailed project documentation and process explanation.

Thank you for your time and interest in this project. For further exploration and validation.

laptop-price-prediction's People

Contributors

aliiimaher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.