This is a demo ML classifier that runs in a Docker container and exposes an API enpoint for predictions.
- Clone the repository.
git clone https://github.com/bjornorri/moonraker.git
- Navigate to the project directory.
cd moonraker
- Build the docker container image.
docker build -t moonraker .
- Start the docker container .
docker run moonraker
- Locate the Docker container's IP address.
docker ps # Get container id
docker inspect CONTAINER_ID # Get IP address
- Access the prediction API at
http://IP_ADDRESS/predict?VisitsLastYear=123&QuestionTextLength=456
. Example:
curl "http://172.17.0.3/predict?VisitsLastYear=123&QuestionTextLength=456"
Provide the following parameters as query parameters. These are used as input features for the model.
Name | Type |
---|---|
VisitsLastYear | integer |
QuestionTextLength | integer |
Example response:
{ "prediction": false }
To see how the model was created, view the provided Jupyter notebook.
- Clone the repository.
git clone https://github.com/bjornorri/moonraker.git
- Navigate to the project directory.
cd moonraker
- (Optional) Create and activate a virtual environment.
python3 -m venv venv
source venv/bin/activate
- Install dependencies.
pip install -r requirements.txt
- Run the Jupyter server. This should launch your browser.
jupyter notebook
- Open
community_questions.ipynb
.
If I create a more advanced model (optional task), I will do it on another branch in this repository.