Skip to content

Latest commit

 

History

History
95 lines (83 loc) · 3.88 KB

File metadata and controls

95 lines (83 loc) · 3.88 KB

Employee Retention Prediction backend API with Tensorflow, Flask, and Cloud Run

Create a simple Machine Learning API to predict Employee Retention Use it as reference only!

Stacks

Development Step

  1. Create conda environment with taskfile command
task conda-create
  1. Activate the new created conda environment
conda activate <env_name |default: 2-flask-api>
  1. Install conda requirements first then pip environments (Must in this sequence2)
task conda-install
task pip-install
  1. Create .env file in root folder with this specifications
Variables Function Example
PORT your_API_port 8081
MODEL_LAYER your_model_layer_path model/hdf5/v1/retention_prediction_model.json
MODEL_WEIGHTS your_model_weights_path model/hdf5/v1/retention_prediction_weights.h5
STANDARD_SCALER your_standard_scaler_path (opt) model/hdf5/v1/standard_scaler.pkl
  1. Create new docker image
task docker-build
  1. Run a new docker container
task docker-run
  1. Test the API with Postman. Import postman collection and environment and start the testing.

Production Step

⚠️ WIP

Misc

  • If you encounter error below, run sudo apt install python3-tk
ModuleNotFoundError: No module named 'tkinter'

References :

[1] https://www.digitalocean.com/community/tutorials/how-to-build-a-deep-learning-model-to-predict-employee-retention-using-keras-and-tensorflow

[2] https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service