class_docstr: Suggests an architecture based on the Harmonica algorithm.
docstr: Suggests a new architecture for Phoenix using the harmonica model.
  
  For details please see:
  https://arxiv.org/pdf/1706.00764.pdf
  
  Args:
    trials: a list of Trial objects
    hparams: The suggested hparams.
    my_trial_id: integer - the trial id which is making the call.
    model_dir: string - the model directory.
  
  Returns:
    an architecture and None - a np.array of integers and None.
docstr_tok: ["Suggests","a","new","architecture","for","Phoenix","using","the","harmonica","model",".","For","details","please","see",":","https",":","\/\/arxiv.org\/pdf\/1706.00764.pdf","Args",":","trials",":","a","list","of","Trial","objects","hparams",":","The","suggested","hparams",".","my_trial_id",":","integer","-","the","trial","id","which","is","making","the","call",".","model_dir",":","string","-","the","model","directory",".","Returns",":","an","architecture","and","None","-","a","np.array","of","integers","and","None","."]
code: def get_suggestion(
      self, trials, hparams, my_trial_id=None, model_dir=None
  ):
      """Suggests a new architecture for Phoenix using the harmonica model.
  
      For details please see:
      https://arxiv.org/pdf/1706.00764.pdf
  
      Args:
        trials: a list of Trial objects
        hparams: The suggested hparams.
        my_trial_id: integer - the trial id which is making the call.
        model_dir: string - the model directory.
  
      Returns:
        an architecture and None - a np.array of integers and None.
      """
      lasso_solver = linear_model.Lasso(
          fit_intercept=True, alpha=self._alpha
      )
  
      # Getting the features/labels for the linear regression.
      x, y = self.batch_sample(trials)
  
      # Not enough data points for regression. Falling on hparams architecture.
      if len(y) < self._min_for_regression:
          initial_architecture = [
              block_builder.BlockType[block_type]
              for block_type in hparams.initial_architecture
          ]
          return (
              np.array(
                  architecture_utils.fix_architecture_order(
                      initial_architecture,
                      self._phoenix_spec.problem_type,
                  )
              ),
              None,
          )
  
      feature_extender = PolynomialFeatures(
          self._degree, interaction_only=True
      )
  
      # Expanding to polynomial features
      x = self._get_polynomial_expansion(feature_extender, x)
  
      zeroed_coeff = None
      relevant_variables = []
      for _ in range(self._num_of_restarts):
          logging.info("Running linear regression..")
          lasso_solver.fit(x, y)
          coef = lasso_solver.coef_
          # Sort the coefficients
          index = np.argsort(-np.abs(coef))
          # Zero out all coefficients but the largets self._n_mono
          value = coef[index[self._n_mono - 1]]
          zeroed_coeff = np.asarray(coef)
          before_zeroing = np.copy(zeroed_coeff)
          low_values_flags = (
              zeroed_coeff < value
          )  # Where values are low
          zeroed_coeff[low_values_flags] = 0  # All low values set to 0
          relevant_variables.extend(
              self._extract_relevant_variables_indices(
                  feature_extender, zeroed_coeff
              )
          )
  
      if self._debug_mode and my_trial_id:
          self._write_model(model_dir, before_zeroing, my_trial_id)
  
      return (
          self._get_good_architecture(
              feature_extender,
              self._num_random_samples,
              before_zeroing,
              relevant_variables,
          ),
          None,
      )
  
imports: import cmath
  import os
  from absl import logging
  from model_search import block_builder
  from model_search.architecture import architecture_utils
  from model_search.search import search_algorithm
  import numpy
  from sklearn import linear_model
  from sklearn import preprocessing
  import tensorflow.compat.v2
label_desc: Use image node_id 10 for calling the Harmonica obj's underlying member method code with example usage: obj.get_suggestion(trials, hparams, my_trial_id, model_dir) and returns: self,  None, np,  None