train
This commit is contained in:
19
model/predict.py
Normal file
19
model/predict.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import joblib
|
||||
import pandas as pd
|
||||
import sys
|
||||
import json
|
||||
|
||||
def predict():
|
||||
model_path = sys.argv[1]
|
||||
features_json = sys.stdin.read()
|
||||
features_dict = json.loads(features_json)
|
||||
|
||||
df = pd.DataFrame([features_dict])
|
||||
|
||||
model = joblib.load(model_path)
|
||||
|
||||
prediction = model.predict(df)
|
||||
print(prediction[0])
|
||||
|
||||
if __name__ == "__main__":
|
||||
predict()
|
||||
Reference in New Issue
Block a user