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","`","."]
code: def __init__(self, epochs=1000):
      self.epochs = epochs
      self.n_classes = None
      self.temperature = 1.0  # default is no scaling
      self.history = []
      self.early_stopping = False
      self.lr = None
  
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 1 to create a new TemperatureCalibration object from inherited base classes: object with example: obj = TemperatureCalibration(epochs)