docstr: Samples candidates parameters from the top 33% of population. If less than min_candidates
  then use a random sample
  
  Returns
  dict: parameter dictionary.
docstr_tok: ["Samples","candidates","parameters","from","the","top","33","%","of","population",".","If","less","than","min_candidates","then","use","a","random","sample","Returns","dict",":","parameter","dictionary","."]
code: def _get_candidate(
      self, parameters, results, lower_is_better, min_candidates=10
  ):
      """
      Samples candidates parameters from the top 33% of population. If less than min_candidates
      then use a random sample
  
      Returns
      dict: parameter dictionary.
      """
      if results.shape[0] > 0:
          population = results.loc[
              results["Status"] != "INTERMEDIATE", :
          ]  # select only completed trials
      else:
          population = None
      if population is None or population.shape[0] < min_candidates:
          trial_param_values = {}
          for parameter_object in parameters:
              trial_param_values[
                  parameter_object.name
              ] = parameter_object.sample()
          return trial_param_values
      population = population.sort_values(
          by="Objective", ascending=lower_is_better
      )
      idx = sherpa_rng.randint(
          low=0, high=population.shape[0] // 3
      )  # pick randomly among top 33%
      trial_all_values = population.iloc[
          idx
      ].to_dict()  # extract the trial values on results table
      trial_param_values = {
          param.name: trial_all_values[param.name]
          for param in parameters
      }  # Select only parameter values
      return trial_param_values
  
imports: import os
  import random
  import numpy
  import logging
  import sherpa
  import pandas
  import sklearn.gaussian_process
  from sherpa.core import Choice, Continuous, Discrete, Ordinal, AlgorithmState
  from sherpa.core import rng
  import sklearn.model_selection
  import collections
label_desc: Use image node_id 3 for calling the Genetic obj's underlying member method code with example usage: obj._get_candidate(parameters, results, lower_is_better, min_candidates) and returns: trial_param_values, trial_param_values