Giter VIP home page Giter VIP logo

ml-api's Introduction

FastAPI - fastML

That repository contains an API to send request our Random Forest Classification model.

FastAPI is a modern, fast, web framework for building APIs with Python 3.7+ based on standard Python type hints. It is designed to be easy to use and to enable the development of high-performance APIs quickly.


USED LIBRARIES:

    FastAPI
    BaseModel
    pickle
    pandas
    sklearn
PICKLE:

The pickle module is frequently used to package (serialize) and store machine learning models in Python.

import pickle
with open('random-forest.pkl', 'wb') as file:
    pickle.dump(rfc, file)
RUN COMMANDS:
python -m venv fastml
source fastml/bin/activate (mac) or  .\fastml\Scripts\activate (windows)
pip install uvicorn gunicorn fastapi pydantic sklearn pandas
uvicorn random-classifier-api:app --reload
EXAMPLE REQUEST:
curl --location 'http://localhost:8000/' \
--header 'Content-Type: application/json' \
--data '{
    "age":7,
    "gender":0,
    "number_of_siblings":4,
    "weekly_tv_watch_hour": 3,
    "weekly_play_pc_game_hour":4,
    "life_pleasure":5,
    "average_games_score":80,
    "average_game_time_in_minute":15,
    "activity_click_count":30,
    "activity_view_count":65,
    "activity_view_time_in_minute":20,
    "Anne":false,
    "Baba":true,
    "Ilkokul":false,
    "Lise":false,
    "OkumaYazmaBilmiyor": true,
    "Ortaokul": true,
    "Universite":false
}'

ml-api's People

Contributors

beyzayukseel avatar

Stargazers

Serdar Raşit Fırlayiş 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.