class_docstr: A class for temperature calibration for binary and multi-class classification problems.
  
  For binary classification, Platt Scaling is used for calibration. Platt Scaling was
  proposed in the paper Probabilistic outputs for support vector machines and comparisons to regularized
  likelihood methods, J. C. Platt, Advances in large margin classifiers, 10(3): 61-74, 1999.
  
  For multi-class classification, Temperature Calibration is used. It is an extension of Platt Scaling
  and it was proposed in the paper On Calibration of Modern Neural Networks, C. Guo et. al., ICML, 2017.
  
  In Temperature Calibration, a classifier's non-probabilistic outputs, i.e., logits, are
  scaled by a trainable parameter called Temperature. The softmax is applied to the rescaled
  logits to calculate the probabilistic output. As noted in the cited paper, Temperature
  Scaling does not change the maximum of the softmax function so the classifier's prediction
  remain the same.
  
  .. seealso::
  
     `Examples using calibration <https://stellargraph.readthedocs.io/en/stable/demos/calibration/index.html>`__.
  
     Related functionality: :func:`.expected_calibration_error`, :func:`.plot_reliability_diagram`, :class:`.IsotonicCalibration`.
class_docstr_tok: ["A","class","for","temperature","calibration","for","binary","and","multi-class","classification","problems",".","For","binary","classification",",","Platt","Scaling","is","used","for","calibration",".","Platt","Scaling","was","proposed","in","the","paper","Probabilistic","outputs","for","support","vector","machines","and","comparisons","to","regularized","likelihood","methods",",","J.","C.","Platt",",","Advances","in","large","margin","classifiers",",","10","(","3",")",":","61-74",",","1999",".","For","multi-class","classification",",","Temperature","Calibration","is","used",".","It","is","an","extension","of","Platt","Scaling","and","it","was","proposed","in","the","paper","On","Calibration","of","Modern","Neural","Networks",",","C.","Guo","et",".","al.",",","ICML",",","2017",".","In","Temperature","Calibration",",","a","classifier","'s","non-probabilistic","outputs",",","i.e.",",","logits",",","are","scaled","by","a","trainable","parameter","called","Temperature",".","The","softmax","is","applied","to","the","rescaled","logits","to","calculate","the","probabilistic","output",".","As","noted","in","the","cited","paper",",","Temperature","Scaling","does","not","change","the","maximum","of","the","softmax","function","so","the","classifier","'s","prediction","remain","the","same",".","..","seealso",":",":","`","Examples","using","calibration","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/calibration\/index.html",">","`","__",".","Related","functionality",":",":","func",":","`",".expected_calibration_error","`",",",":","func",":","`",".plot_reliability_diagram","`",",",":","class",":","`",".IsotonicCalibration","`","."]
docstr: Helper function for plotting the training history.
docstr_tok: ["Helper","function","for","plotting","the","training","history","."]
code: def plot_training_history(self):
      """
      Helper function for plotting the training history.
      """
      fig, (ax1, ax2) = plt.subplots(1, 2, sharex=True, figsize=(12, 5))
      ax1.plot(self.history[:, 0], label="Training")
      if self.history.shape[1] == 3:  # has validation cost
          ax1.plot(self.history[:, 1], label="Validation")
      ax1.set_title("Cost")
      ax1.set_xlabel("Epoch")
      ax1.set_ylabel("Cost")
      ax1.legend(loc="upper right")
      ax2.plot(self.history[:, -1])
      ax2.set_title("Temperature")
      ax2.set_xlabel("Epoch")
      ax2.set_ylabel("Temperature")
  
imports: import numpy
  import matplotlib.pyplot
  import tensorflow
  from sklearn.isotonic import IsotonicRegression
  from sklearn.linear_model import LogisticRegression
label_desc: Use image node_id 5 for calling the TemperatureCalibration obj's underlying member method code with example usage: obj.plot_training_history() without return types