Skip to content

Fabioburgos/chiper_tech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chiper - FastAPI

This API was created within the recruitment process for Chiper.

API Reference

Make the prediction

  GET /prediction/{preddays}
Parameter Type Description
preddays integer Required. The days you want to forecast

To make the prediction you must put in the address bar of your browser the next url: http://127.0.0.1:8000/prediction/{preddays}; you must change the word "preddays" to the number of days you want to forecast.

After you press enter, the API will run the prediction model and show you the predictions as follows:

App Screenshot

Installation

Clone the repo wherever you want:

  https://github.com/Fabioburgos/chiper_tech.git

Virtual enviroment

In order to install all the dependencies, create a virtual enviroment as follow:

Install virtualenv into your local machine:

  pip install virtualenv

After that, you can create your virtualenv as follow:

  pip virtualenv ./

When you create your virtual enviroment, some folders and files are created inside of your project directory.

After you created the virtualenv, it need to be activated typing the route for the "Scripts" folder following by \activate.

  D:\chiper_tech\chiper_tech>Scripts\activate

You will notice that the name of the virtual enviroments will appear at the beggining:

  (chiper_tech) D:\chiper_tech\chiper_tech>

Dependencies

In order to get working the project, we need to install all the libraries or frameworks:

  pip install -r requirements.txt

Automatically all the libraries and frameworks will be downloaded and installed.

FastAPI and Uvicorn

If you want to interact with the API, you need to create the webserver through Uvicorn following the syntax:

  uvicorn main:app --reload

Screenshots

App Screenshot

To access into the API, follow the url.

API docs

FastAPI offer a strong tool to see the API documentation. To see it just add to the original url:

  /docs

API predictions

The number of days to get the prediction can be set from the API docs. App Screenshot

Deploy the menu for the entrypoint and click on "Try it now", after that, type the value of "day" you want (forecast) and then click on "Execute".

If everything went well, you'll get a 200 code response with the prediction for the number of days you desired. App Screenshot.

About

Technical test for ML Engineer job position

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published