How to get validation results displayed?

I have the following code to train. The validation records are based on a column indicating that they are part of validation or not.

valid_idx = []
all_idx = []

with open('/content/total_training.csv', newline='') as csvfile:
  reader = csv.reader(csvfile, delimiter=',')
  for row in reader:
    if row[74] == 'true':
      valid_idx.append(reader.line_num - 1)
    all_idx.append(reader.line_num - 1)

coord_labels, semantic_labels = [], []
for i in range(18):
    coord_labels += [f'x{i+1}', f'y{i+1}', f'conf{i+1}']
    semantic_labels += [f'sem{i+1}']
dls = TabularDataLoaders.from_csv(
    cont_names = coord_labels,
    cat_names = semantic_labels,
    procs = [Categorify, Normalize],
    valid_idx = valid_idx,

The CSV also contains an ID value which is important for me (first column of the CSV).

After plotting the confusion matrix:

I would like to know the ID’s of the rows that were predicted as lying_on_floor, but were in fact sitting. I played around with learner.show_results but that doesn’t seem to be it. Is there an easy way to accomplish this?

1 Like