class_docstr: Create confusion matrices using the `PyCM library <https://github.com/sepandhaghighi/pycm>`_.
  
  Args:
      kwargs: Additional keyword args to pass to the `ConfusionMatrix` call
docstr: Save `ConfusionMatrix` objects from this callback to `.html` files
  
  Args:
      filename (str): The name of the file, will be formatted with state to create unique filenames if desired
  
  See:
      `PyCM Source (save_html) <https://github.com/sepandhaghighi/pycm/blob/master/pycm/pycm_obj.py>`_
  
  Returns:
      PyCM: self
docstr_tok: ["Save","`","ConfusionMatrix","`","objects","from","this","callback","to","`",".html","`","files","Args",":","filename","(","str",")",":","The","name","of","the","file",",","will","be","formatted","with","state","to","create","unique","filenames","if","desired","See",":","`","PyCM","Source","(","save_html",")","<","https",":","\/\/github.com\/sepandhaghighi\/pycm\/blob\/master\/pycm\/pycm_obj.py",">","`","_","Returns",":","PyCM",":","self"]
code: def to_html_file(self, filename, *args, **kwargs):
      """Save `ConfusionMatrix` objects from this callback to `.html` files
  
      Args:
          filename (str): The name of the file, will be formatted with state to create unique filenames if desired
  
      See:
          `PyCM Source (save_html) <https://github.com/sepandhaghighi/pycm/blob/master/pycm/pycm_obj.py>`_
  
      Returns:
          PyCM: self
      """
  
      def handler(cm, state):
          string_state = {str(key): state[key] for key in state.keys()}
          cm.save_html(filename.format(**string_state), *args, **kwargs)
  
      return self.with_handler(handler)
  
imports: from __future__ import print_function
  import torch
  import torchbearer
  from torchbearer import Callback
  from torchbearer.bases import cite
  from torchbearer.metrics import EpochLambda, MetricList
label_desc: Use image node_id 10 for calling the PyCM obj's underlying member method code with example usage: obj.to_html_file(filename) and returns: self