Classes to build objects to better interpret predictions of a model
Interpretation
is a helper base class for exploring predictions from trained models. It can be inherited for task specific interpretation classes, such as ClassificationInterpretation
. Interpretation
is memory efficient and should be able to process any sized dataset, provided the hardware could train the same model.
Note:
Interpretation
is memory efficient due to generating inputs, predictions, targets, decoded outputs, and losses for each item on the fly, using batch processing where possible.With the default of k=None
, top_losses
will return the entire dataset's losses. top_losses
can optionally include the input items for each loss, which is usually a file path or Pandas DataFrame
.
To plot the first 9 top losses:
interp = Interpretation.from_learner(learn)
interp.plot_top_losses(9)
Then to plot the 7th through 16th top losses:
interp.plot_top_losses(range(7,16))
Like Learner.show_results
, except can pass desired index or indicies for item(s) to show results from.