Building Sales Prediction Web Application using Machine Learning Dataset

235
Python

Introduction

                           

Part 1: Generating the model

Sales Prediction Web Application : Dataset

Column values

    • Next, we run our trained model on test dataset to get model predictions and check model accuracy
      y_pred = model.predict(test_temp[features])
      from sklearn.metrics import mean_squared_error
      from math import sqrt
      
      rmse = sqrt(mean_squared_error(y_true, y_pred))
      print(rmse)
      #Output: 1.5555409360901584

Part 2: Creating backend API from model


Part 3: Deploying backend API to Heroku


Part 4: Creating a client-side app using react and bootstrap

  • We need to add files as per instructions provided by bootstrap docs in the index.html file as shown below:-
    <head>
    ...
    <link href="%PUBLIC_URL%/logo192.png" />
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    ...
    </head>
    <body>
    ...
    <div id="root"></div>
    ...
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
    ...
    </body>

This leaves us with the final step of the deployment of our web app online. So hold your patience and persistence a bit longer and let’s start off with the last step of our project.


Part 5: Deploying the client-side app to Netlify

Image for post

End Notes