I am using a saved model to run inference for 1200+ image files. I want to save the predictions from get_preds() function to an Excel file in this format - File Name, Prediction, Class.
The objective is to submit the excel file to our governance group so that they can calculate the ROC.
Hi. I am not sure what help you are asking for specifically. The simplest file format that Excel can read is CSV. You have many options for writing a CSV file: in Python, the csv package, numpy.savetxt, and pandas.DataFrame.to_csv.
Here is a code fragment I wrote for submitting probability predictions to Kaggle. Maybe it can be adapted to your problem.
The missing piece for me was the lambda statement. I was able to solve my problem by first creating a ImageDataBunch object instead of passing ImageList to the load_learner method and then used your testdf[‘label’] line!!