parameters: (results, parameters, min_count=0)
return_statement: return full_results
docstring: A helper function to aggregate results for repeated trials.
  
          Groups results by parameter values and computes mean and standard error of
          the mean. The returned dataframe's Objective column is the mean within
          groups. The standard error is denoted ObjectiveStdErr.
  
          # Arguments:
              results (pandas.Dataframe): the results dataframe.
              min_count (int): the minimum count within groups. Groups with fewer
                  observations than min_count are excluded from the results.
  
          # Returns:
              pandas.Dataframe: the aggregated dataframe.
docstring_summary: A helper function to aggregate results for repeated trials.
docstring_tokens: A helper function to aggregate results for repeated trials .
function: def aggregate_results(results, parameters, min_count=0):
          """
          A helper function to aggregate results for repeated trials.
  
          Groups results by parameter values and computes mean and standard error of
          the mean. The returned dataframe's Objective column is the mean within
          groups. The standard error is denoted ObjectiveStdErr.
  
          # Arguments:
              results (pandas.Dataframe): the results dataframe.
              min_count (int): the minimum count within groups. Groups with fewer
                  observations than min_count are excluded from the results.
  
          # Returns:
              pandas.Dataframe: the aggregated dataframe.
          """
          intermediate = results.query("Status == 'INTERMEDIATE'")
          completed = results.query("Status != 'INTERMEDIATE'")
  
          # aggregate
          aggregate_completed = completed.groupby([p.name for p in parameters]
                                                  + ['Status']) \
                                         .agg({'Objective': ['mean', 'var', 'count'],
                                               'Iteration': 'max'})
  
          # flatten hierarchical column names
          aggregate_completed.columns = [''.join(c.capitalize() for c in col).strip()
                                         for col in
                                         aggregate_completed.columns.values]
  
          # add variance and finalize
          aggregate_completed = aggregate_completed.reset_index() \
              .assign(
              ObjectiveStdErr=lambda x: numpy.sqrt(x['ObjectiveVar'] / (x['ObjectiveCount'] - 1))) \
              .rename({'IterationMax': 'Iteration'}, axis=1) \
              .query("ObjectiveCount >= {}".format(
              min_count))
  
          aggregate_intermediate = intermediate.groupby([p.name for p in parameters]
                                                        + ['Status', 'Iteration']) \
              .agg({'Objective': ['mean', 'var', 'count']})
          aggregate_intermediate.columns = [
              ''.join(c.capitalize() for c in col).strip() for col in
              aggregate_intermediate.columns.values]
  
          aggregate_intermediate = aggregate_intermediate.reset_index() \
              .assign(
              ObjectiveStdErr=lambda x: numpy.sqrt(x['ObjectiveVar'] / (x['ObjectiveCount'] - 1))) \
              .query("ObjectiveCount >= {}".format(
              min_count))
  
          full_results = pandas.concat([aggregate_intermediate,
                                        aggregate_completed],
                                       sort=False)\
              .rename({"ObjectiveMean": "Objective"}, axis=1)
  
          return full_results
function_tokens: def aggregate_results ( results , parameters , min_count = 0 ) : intermediate = results . query ( "Status == 'INTERMEDIATE'" ) completed = results . query ( "Status != 'INTERMEDIATE'" ) # aggregate aggregate_completed = completed . groupby ( [ p . name for p in parameters ] + [ 'Status' ] ) . agg ( { 'Objective' : [ 'mean' , 'var' , 'count' ] , 'Iteration' : 'max' } ) # flatten hierarchical column names aggregate_completed . columns = [ '' . join ( c . capitalize ( ) for c in col ) . strip ( ) for col in aggregate_completed . columns . values ] # add variance and finalize aggregate_completed = aggregate_completed . reset_index ( ) . assign ( ObjectiveStdErr = lambda x : numpy . sqrt ( x [ 'ObjectiveVar' ] / ( x [ 'ObjectiveCount' ] - 1 ) ) ) . rename ( { 'IterationMax' : 'Iteration' } , axis = 1 ) . query ( "ObjectiveCount >= {}" . format ( min_count ) ) aggregate_intermediate = intermediate . groupby ( [ p . name for p in parameters ] + [ 'Status' , 'Iteration' ] ) . agg ( { 'Objective' : [ 'mean' , 'var' , 'count' ] } ) aggregate_intermediate . columns = [ '' . join ( c . capitalize ( ) for c in col ) . strip ( ) for col in aggregate_intermediate . columns . values ] aggregate_intermediate = aggregate_intermediate . reset_index ( ) . assign ( ObjectiveStdErr = lambda x : numpy . sqrt ( x [ 'ObjectiveVar' ] / ( x [ 'ObjectiveCount' ] - 1 ) ) ) . query ( "ObjectiveCount >= {}" . format ( min_count ) ) full_results = pandas . concat ( [ aggregate_intermediate , aggregate_completed ] , sort = False ) . rename ( { "ObjectiveMean" : "Objective" } , axis = 1 ) return full_results