Hi again,
I think you should avoid reading the same creditcard.csv both in the python function and UiPath
Keep it simple and short.
import joblib
import json
def predict():
"""
This function predicts (Something)
in_argument : Your input argument
Returns : Predicted json string to UiPath
"""
with open(‘./creditcard.csv’, ‘rb’) as input_file:
bytes = input_file.read()
model = joblib.load(‘finalized_model.sav’)
payload = json.loads(in_argument)
result = model.predict_proba(payload)
return json.dumps(result.tolist())
- Python Scope
- Load Python Script
- Invoke Python Method (without any parameters) for example you only have to call “predict”
without any parameters - Get Python Object