Git Product home page Git Product logo

pcos-prediction-backend's Introduction

PCOS Prediction API

PCOS Prediction API built with FastAPI and deployed on render.

Machine learning model built with Google Colab.

Docs available at /docs.

Running on Local Machine

  1. Clone repository
git clone https://github.com/ranmerc/pcos-prediction-backend.git
  1. Create Virtual Environment
# Creates Virtual Environment named venv
python -m venv venv
  1. Activate venv
source venv/Scripts/activate
  1. Install packages
pip install -r requirements.txt
  1. Running Uvicorn Server
uvicorn main:app --reload
  1. Deactivating Virtual Environment
deactivate
  • Generating requirements.txt
pip freeze > requirements.txt

How it works?

We pickle the trained model and StandardScaler object -

import pickle
pickle.dump(model, open("model.sav", 'wb'))
pickle.dump(standard_scalar, open("sc.sav", 'wb'))

Then we load the model on server and make prediction using it -

loaded_model = pickle.load(open("model.sav", 'rb'))
sc = pickle.load(open("sc.sav", 'rb'))

test_data = []
test_data = sc.transform([test_data])
res = loaded_model.predict(test_data)

Reference

  • Can not activate a virtualenv in GIT bash mingw32 for Windows on Stack Overflow

  • Is it bad to have my virtualenv directory inside my git repository? on Stack Overflow

  • Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module by Cory Schafer on Youtube

  • Deploying FastAPI application to Render by Akash R Chandran

  • What and why behind fit_transform() and transform() in scikit-learn! by Towards Data Science

pcos-prediction-backend's People

Contributors

ranmerc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.