Closed RHRolun closed 5 months ago
Tested with OpenShift AI 2.9.1 and I confirm that I now get
Is Sally's transaction predicted to be fraudulent? (true = YES, false = NO)
False
How likely was Sally's transaction to be fraudulent?
0.00027%
on the first notebook and
[0.00027432802]
not fraud
on the third one.
Thank you!
Great catch.
@RHRolun Do we need to change threshold in notebook 1_experiment_train.ipynb
here?:
https://github.com/rh-aiservices-bu/fraud-detection/blob/main/1_experiment_train.ipynb?short_path=6950d32#L276
sess = rt.InferenceSession("models/fraud/1/model.onnx", providers=rt.get_available_providers())
input_name = sess.get_inputs()[0].name
output_name = sess.get_outputs()[0].name
y_pred_temp = sess.run([output_name], {input_name: scaler.transform(X_test.values).astype(np.float32)})
y_pred_temp = np.asarray(np.squeeze(y_pred_temp[0]))
threshold = 0.995
y_pred = np.where(y_pred_temp > threshold, 1,0)
Ah I missed that, good catch, pushing an update
@cfchase update the threshold adjusted
We didn't use the scaler when calculating the prediction from the inference endpoints, which caused the local predictions in notebook 1 different from the request notebooks. This PR aims to fix that.