class_docstr: Gaussian process regressor.
  Attributes:
      alpha: A hyperparameter.
class_docstr_tok: ["Gaussian","process","regressor",".","Attributes",":","alpha",":","A","hyperparameter","."]
docstr: Incrementally fit the regressor. 
docstr_tok: ["Incrementally","fit","the","regressor","."]
code: def incremental_fit(self, train_x, train_y):
      """Incrementally fit the regressor."""
      if not self._first_fitted:
          raise ValueError(
              "The first_fit function needs to be called first."
          )
  
      train_x, train_y = np.array(train_x), np.array(train_y)
  
      # Incrementally compute K
      up_right_k = edit_distance_matrix(self._x, train_x)
      down_left_k = np.transpose(up_right_k)
      down_right_k = edit_distance_matrix(train_x)
      up_k = np.concatenate((self._distance_matrix, up_right_k), axis=1)
      down_k = np.concatenate((down_left_k, down_right_k), axis=1)
      temp_distance_matrix = np.concatenate((up_k, down_k), axis=0)
      k_matrix = bourgain_embedding_matrix(temp_distance_matrix)
      diagonal = np.diag_indices_from(k_matrix)
      diagonal = (
          diagonal[0][-len(train_x) :],
          diagonal[1][-len(train_x) :],
      )
      k_matrix[diagonal] += self.alpha
  
      try:
          self._l_matrix = cholesky(k_matrix, lower=True)  # Line 2
      except LinAlgError:
          return self
  
      self._x = np.concatenate((self._x, train_x), axis=0)
      self._y = np.concatenate((self._y, train_y), axis=0)
      self._distance_matrix = temp_distance_matrix
  
      self._alpha_vector = cho_solve(
          (self._l_matrix, True), self._y
      )  # Line 3
  
      return self
  
imports: import math
  import random
  from copy import deepcopy
  from functools import total_ordering
  from queue import PriorityQueue
  import numpy
  from scipy.linalg import LinAlgError, cho_solve, cholesky, solve_triangular
  from scipy.optimize import linear_sum_assignment
  from sklearn.metrics.pairwise import rbf_kernel
  from nni.utils import OptimizeMode
  from .graph_transformer import transform
  from .utils import Constant
  from .layers import is_layer
label_desc: Use image node_id 4 for calling the IncrementalGaussianProcess obj's underlying member method code with example usage: obj.incremental_fit(train_x, train_y) and returns: self, self