Skip to main content
Version: v0.10.x

Batch scoring

This example demonstrates how to use the eScorer Python client for batch scoring. You can download the complete example here.

Batch scoring with the Python client

After authenticating the client, you can use the batch_scorer method to perform batch scoring. The batch_scorer method takes the model name and properties file as input and returns the result of batch scoring.

Note

For information on how to autogenerate and populate a properties file to configure batch scoring, see Batch scoring configuration and usage.

result = await client.batch_scorer(
model_name="<model_name>",
properties_filepath="/path/to/file.properties",
verbose=True,
)
Note

The batch scoring call returns a result only once the scoring is complete. If there is an interruption in the connection, the results of the job cannot be retrieved.

Get the logs

result["result"]
****** AWS *******
Thread-3 BAD DATA Too Many Features ROW: = 31487,3500, 36 months,7.74,109.27,9,31200,"Not,Verified",MN,5.73,,1092,9.9,12 Len:15 Features:13 Offset: 1
Thread-3 Model has 13 features but after parsing feature count is 15 check field seperator or maybe the data contains a default seperator.
Total selected rows 39029 Total Read time (ms) 16056
Thread-1 Rows Read 19644 Scored 19644 Error 0 Queue Empty true
Thread-3 Rows Read 19385 Scored 19384 Error 1 Queue Empty true
Upload of file escorer/predictions-2024-05-28-07-51-58.csv to S3 completed

Get the time elapsed

f'{result["time_elapsed"]}s'
135.317s

Feedback