class_docstr: Abstract algorithm that generates new set of parameters.
class_docstr_tok: ["Abstract","algorithm","that","generates","new","set","of","parameters","."]
code: def get_best_result(self, parameters, results, lower_is_better):
      # Get best result so far
      best_idx = (
          results.loc[:, "Objective"].idxmin()
          if lower_is_better
          else results.loc[:, "Objective"].idxmax()
      )
  
      if not numpy.isfinite(best_idx):
          # Can happen if there are no valid results,
          # best_idx=nan when results are nan.
          alglogger.warning(
              "Empty results file! Returning empty dictionary."
          )
          return {}
  
      best_result = results.loc[best_idx, :].to_dict()
      best_result.pop("Status")
      return best_result
  
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 Algorithm obj's underlying member method code with example usage: obj.get_best_result(parameters, results, lower_is_better) and returns: best_result, dict