Jupyter Notebook provided was used to train this model, and the model is then saved in a binary file.
Flask App uses the binary file to load the model, gets the input through user, then RESTful API is used to transfer the request to the Flask Server, where data is processed and result is then forwarded using HTML templates.
First of all, download and install Python.
Install flask , joblib , numpy and sklearn modules using pip/pip3.
pip3 install flask joblib numpy sklearn
Next, change directory to /FLASK and run the file (called app.py
) using python/python3 to start your Flask Server.
Use localhost:5000 to visit the app.
python3 ./FLASK/app.py
You can use docker container to launch the app. Feel free to use this Docker image and run CLI from isolated container:
docker run -d -p 5000:5000 pewxh/salary-prediction-flask
- p is used to publish the port number 5000 of the container to that of our hostmachine.
Read this Article for better understanding.