Skip to content

Use Machine Learning / Natural Language Processing to Predict Price of Product listed and get rmsle < 0.5 and Create a web app to take inputs and display the predicted price.

Notifications You must be signed in to change notification settings

Pranjal-bisht/NLP-Based-Price-Prediction

Repository files navigation

Kaggle Challenge

Task:

To Use Machine Learning to Predict Price of Product listed and get rmsle < 0.5 and Create a web app to take inputs and display the predicted price.

Directory structure:

m-rec/8e23ae047060859fed073e78fb70e4c2f5160b57/
├── README.md             # overview of the project
├── Deployment/           # contains code for Flask Web Application
    ├── app.py            # contain the main code for running the web app
    ├── requirements.txt  # software requirements and dependencies
├── Solutions/            # Contains all the Models used for prediction in this project
    ├── EDA.ipynb         # Contains all the codes for Exploratory data analysis of the dataset (train) provided
    ├── model.ipynb       # Contains the main code for preprocessing and price prediction using ML model (rmsle : 4.9)
    ├── rough/            # Contains all the rough codes that I tried to test on the dataset
├── requirements.txt      # software requirements and dependencies
├── data/                 # Contains the dataset (Train + Test Files)
├── submission.csv        # Contains the predicted values for all the products given in ./data/mercari_test.csv.gz

Process Involved:

I followed this Strategy to approach the solution to this problem.

  1. Target definition (Given)
  2. Data collection & preparation (Given)
  3. Feature engineering
  4. Model training
  5. Model evaluation
  6. Model deployment (Used Flask-a python based web framework)

Technologies Used:

Instructions:

  • Clone the repository in your local pc.
  • Make sure you are in the root directory.
  • Run the following code:
pip install -r requirements.txt                (Python 2)
pip3 install -r requirements.txt               (Python 3)
  • To test the model type the code below and goto to ./Solutions/model.ipynb and run the jupyter notebook.
cd Solutions
  • To test the flask website change directory to Deployment, then install the requirements.txt, and then run app.py using following code:
cd Deployment
pip3 install -r requirements.txt               (Python 3)
python app.py runserver

(If It doesn't work on the first go , try refreshing the website and try again)

  • Type the inputs present in the website like this :

mercari

  • The Predicted price Will be displayed in few seconds , like this :

mercari_pred

Observations and Results:

  • Ridge regression with best hyperparameters takes very less time to train and rmsle is also less than 0.5, so I choose ridge_model to predict the outcome of test_data or mercari_test. Got rmsle as 0.49 using it.
  • The predicted values for products given in ./data/mercari_test.csv.gz is present in submission.csv
  • A full stack website built with Flask as backend and HTML, CSS for frontend is ready to predict the price of products based on input parameters given.

About

Use Machine Learning / Natural Language Processing to Predict Price of Product listed and get rmsle < 0.5 and Create a web app to take inputs and display the predicted price.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published