docstr: Test that the average is correctly computed
docstr_tok: ["Test","that","the","average","is","correctly","computed"]
code: def test_average_statistic(self):
      """Test that the average is correctly computed"""
      data = pd.DataFrame(
          data={
              "id": [0, 0, 0, 0, 1, 1, 1, 1],
              "order": [0, 1, 2, 3, 0, 1, 2, 3],
              "best": [0.1, 0.2, 0.3, 0.5, 0.3, 0.2, 0.5, 0.6],
          }
      )
  
      result = average(data)
  
      ref = (
          data["best"][:4].to_numpy() + data["best"][4:].to_numpy()
      ) / 2
      numpy.testing.assert_equal(result["best_mean"].to_numpy(), ref)
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.ensemble import AdaBoostRegressor, BaggingRegressor, ExtraTreesRegressor, GradientBoostingRegressor, RandomForestRegressor
  from orion.analysis.base import average, flatten_numpy, flatten_params, ranking, to_numpy, train_regressor
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 3 for calling the TestAverage obj's underlying member method code with example usage: obj.test_average_statistic() without return types