class_docstr: Build a Curve Model to predict the performance
  
  Algorithm: https://github.com/Microsoft/nni/blob/master/src/sdk/pynni/nni/curvefitting_assessor/README.md
  
  Parameters
  ----------
  target_pos : int
      The point we need to predict
class_docstr_tok: ["Build","a","Curve","Model","to","predict","the","performance","Algorithm",":","https",":","\/\/github.com\/Microsoft\/nni\/blob\/master\/src\/sdk\/pynni\/nni\/curvefitting_assessor\/README.md","Parameters","--","--","--","--","--","target_pos",":","int","The","point","we","need","to","predict"]
docstr: use least squares to fit all default curves parameter seperately
  
  Returns
  -------
  None
docstr_tok: ["use","least","squares","to","fit","all","default","curves","parameter","seperately","Returns","--","--","--","-","None"]
code: def fit_theta(self):
      """use least squares to fit all default curves parameter seperately
  
      Returns
      -------
      None
      """
      x = range(1, self.point_num + 1)
      y = self.trial_history
      for i in range(NUM_OF_FUNCTIONS):
          model = curve_combination_models[i]
          try:
              # The maximum number of iterations to fit is 100*(N+1), where N is the number of elements in `x0`.
              if model_para_num[model] == 2:
                  a, b = optimize.curve_fit(all_models[model], x, y)[0]
                  model_para[model][0] = a
                  model_para[model][1] = b
              elif model_para_num[model] == 3:
                  a, b, c = optimize.curve_fit(all_models[model], x, y)[
                      0
                  ]
                  model_para[model][0] = a
                  model_para[model][1] = b
                  model_para[model][2] = c
              elif model_para_num[model] == 4:
                  a, b, c, d = optimize.curve_fit(
                      all_models[model], x, y
                  )[0]
                  model_para[model][0] = a
                  model_para[model][1] = b
                  model_para[model][2] = c
                  model_para[model][3] = d
          except (
              RuntimeError,
              FloatingPointError,
              OverflowError,
              ZeroDivisionError,
          ):
              # Ignore exceptions caused by numerical calculations
              pass
          except Exception as exception:
              logger.critical("Exceptions in fit_theta: %s", exception)
  
file_path: nni/nni/algorithms/hpo/curvefitting_assessor/model_factory.py
imports: import logging
  import numpy
  from scipy import optimize
  from .curvefunctions import *
label_desc: Use image node_id 2 for calling the CurveModel obj's underlying member method code with example usage: obj.fit_theta() without return types