docstr: Test that the variance is correctly computed
docstr_tok: ["Test","that","the","variance","is","correctly","computed"]
code: def test_variance_statistic(self):
      """Test that the variance is correctly computed"""
      data = pd.DataFrame(
          data={
              "id": [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2],
              "order": [0, 1, 2, 3, 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,
                  0.3,
                  0.4,
                  0.1,
                  0.3,
              ],
          }
      )
  
      result = average(data, return_var=True)
  
      ref = data["best"].to_numpy().reshape((3, 4)).var(axis=0, ddof=1)
  
      numpy.testing.assert_allclose(
          result["best_var"].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 4 for calling the TestAverage obj's underlying member method code with example usage: obj.test_variance_statistic() without return types