Skip to content

Commit

Permalink
submmit
Browse files Browse the repository at this point in the history
  • Loading branch information
lx0612 committed Nov 18, 2023
1 parent 19ef86f commit fa12ee7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion project-ml-microservice-kubernetes/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from flask import Flask, request, jsonify
from flask import (
Flask,
request,
jsonify
)
from flask.logging import create_logger
import logging

Expand Down Expand Up @@ -63,6 +67,7 @@ def predict():
# get an output prediction from the pretrained model, clf
prediction = list(clf.predict(scaled_payload))
# TO DO: Log the output prediction value
LOG.info(f'prediction value: {prediction}')
return jsonify({'prediction': prediction})

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<paste log output from Docker prediction, here>
[2023-11-18 08:50:23,684] INFO in app: JSON payload:
[2023-11-18 17:43:35,145] INFO in app: JSON payload:
{'CHAS': {'0': 0}, 'RM': {'0': 6.575}, 'TAX': {'0': 296.0}, 'PTRATIO': {'0': 15.3}, 'B': {'0': 396.9}, 'LSTAT': {'0': 4.98}}
[2023-11-18 08:50:23,695] INFO in app: Inference payload DataFrame:
[2023-11-18 17:43:35,157] INFO in app: Inference payload DataFrame:
CHAS RM TAX PTRATIO B LSTAT
0 0 6.575 296.0 15.3 396.9 4.98
[2023-11-18 08:50:23,703] INFO in app: Scaling Payload:
[2023-11-18 17:43:35,165] INFO in app: Scaling Payload:
CHAS RM TAX PTRATIO B LSTAT
0 0 6.575 296.0 15.3 396.9 4.98
172.17.0.1 - - [18/Nov/2023 08:50:23] "POST /predict HTTP/1.1" 200 -
[2023-11-18 17:43:35,168] INFO in app: prediction value: [20.35373177134412]
172.17.0.1 - - [18/Nov/2023 17:43:35] "POST /predict HTTP/1.1" 200 -

0 comments on commit fa12ee7

Please sign in to comment.