/Prediction-of-Bike-Rental-Count-Linear-Regression-and-Deployment-along-with-deployment

Prediction and Projection for a problem statement by BoomBikes to predict the factors affecting their bike rental count post covid and deploying a model predicting the number of bikes that can be rented for a particular day.

Primary LanguageJupyter Notebook

Boom-Bikes Bike Rentals.

A US bike-sharing provider BoomBikes has recently suffered considerable dips in their revenues due to the ongoing Corona pandemic. The company is finding it very difficult to sustain in the current market scenario. So, it has decided to come up with a mindful business plan to be able to accelerate its revenue as soon as the ongoing lockdown comes to an end, and the economy restores to a healthy state. They also want to expand their business outside US. Hence they want their potential partners to forecast the number of bikes rented by customers in various conditions.

Business Goal.

The objective of this project is to model the demand for shared bikes with the available independent variables. It will be used by the management and potential partners to understand how exactly the demands vary with different features. They can accordingly manipulate the business strategy to meet the demand levels and meet the customer's expectations. Further, the model will be a good way for management to understand the demand dynamics of a new market.

Below is the preview of the application home-page.

Below is the preview of the prediction page

Components of the project.

Project is divided into 2 parts:

Part 1: Building Machine Learning Model and Prediction.

  1. Data: day.csv
  2. Boombikes Prediction model.ipynb:The main ML notebook. It consists of the following tasks:
    • Data understanding and Data cleaning.
    • Detailed EDA and inferences in every step.
    • Data Preparation for modelling.
    • Training the model.
    • Model Evaluation: p-value, VIF, r-squared, adjusted r squared, residual analysis.
    • Hyper parameter tuning.
    • Prediction and inferences.

Part 2: Deployment.

  1. model.py: It mostly is the subpart of Boombikes Prediction model.ipynb having the code where model is built and trained. At the end, the trained model is saved in the memory of a pickle package- model.pkl.
  2. app.py: It contains the code of my flask app. Flask is a micro web framework written in Python.
  3. Basic flow of the app:
    1. A flask object is instantiated: An object of Flask class is our WSGI application. Flask constructor takes the name of current module (__name__) as argument.
      app= Flask(__name__, static_url_path='/static') enambles us to use the static folder while building the front-end.
    2. A pickle object is created named my_model.
    3. App routing: App routing is used to map the specific URL with the associated function that is intended to perform some task. @app.route('/') is used to access apply function home() in it. It executes the frontend using home.html which inside it has an href to execute 'index' on click to use funtion predictionpage() from the app. Function predictionpage() opens our prediction page index.html. Clicking on predict button after giving correct inputs to the fields executes the function predict() which fetches data from the front-end, scales the required fields, performs prediction using the my_model object, formats the output and sends the predicted text to the front-end.

    Type of Cloud service used for this project is Platform As A Service(PAAS)- Heroku.

    Click here to read the document where I have shown the steps I followed for deployment.

    Technologies and IDEs Used.

           

    Machine learning Engineer and Developer

    Souvik Ganguly