Coder Social home page Coder Social logo

lesara-clv's Introduction

lesara-clv

Dockerized Lesara Customer Value Project

Installation

Installing

Get Docker first:

And clone the repo by using git or download the master tarball to your computer:

$ cd lesara-clv/

Apply the following commands respectively.

$ docker-compose build

Building predict service may take longer than expected, please be patient. (See here)

Running

$ docker-compose up -d

To stop project; use docker-compose stop command.

Check processes by doing docker ps. You should see something like this:

CONTAINER ID        IMAGE                COMMAND                  CREATED                  STATUS              PORTS                    NAMES
083e8970d241        lesara-clv_predict   "python main.py"         Less than a second ago   Up 5 seconds                                 lesara-clv_predict_1
25907e5f28b6        lesara-clv_api       "python api.py"          Less than a second ago   Up About a minute   0.0.0.0:5000->5000/tcp   lesara-clv_api_1
fa1a95628353        redis:4.0.9-alpine   "docker-entrypoint.s…"   7 minutes ago            Up 9 minutes        6379/tcp                 lesara-clv_redis_1

Check again your docker processes for a while later. You will see the predict container disappeared (completed).

CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                    NAMES
25907e5f28b6        lesara-clv_api       "python api.py"          40 seconds ago      Up 2 minutes        0.0.0.0:5000->5000/tcp   lesara-clv_api_1
fa1a95628353        redis:4.0.9-alpine   "docker-entrypoint.s…"   8 minutes ago       Up 10 minutes       6379/tcp                 lesara-clv_redis_1

If you want to re-run predict service again; just type $ docker-compose up -d predict. Generated scores will be updated.

Now you are ready to access predicted scores through the API.

$ curl http://localhost:5000/api/customers/0867716461bb557156b6f22ae2ee8122

You should see something like this:

{
    "customer_id": "0867716461bb557156b6f22ae2ee8122",
    "predicted_clv": "292.951564"
}

Tests

$ docker-compose run --rm predict pytest --verbosity=3

Cheers! 🍻

lesara-clv's People

Contributors

yigitgenc avatar

Stargazers

 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.