class_docstr: Hierarchical reconciliation transformer.
  
  Hierarchical reconciliation is a transformation which is used to make the
  predictions in a hierarchy of time-series sum together appropriately.
  
  The methods implemented in this class only require the structure of the
  hierarchy or the forecasts values for reconciliation.
  
  These functions are intended for transforming hierarchical forecasts, i.e.
  after prediction. However they are general and can be used to transform
  hierarchical time-series data.
  
  Please refer to [1]_ for further information
  
  Parameters
  ----------
  method : {"bu", "ols", "wls_str", "td_fcst"}, default="bu"
      The reconciliation approach applied to the forecasts
          "bu" - bottom-up
          "ols" - ordinary least squares
          "wls_str" - weighted least squares (structural)
          "td_fcst" - top down based on (forecast) proportions
  
  See Also
  --------
  Aggregator
  ReconcilerForecaster
  
  References
  ----------
  .. [1] https://otexts.com/fpp3/hierarchical.html
  
  Examples
  --------
  >>> from sktime.forecasting.trend import PolynomialTrendForecaster
  >>> from sktime.transformations.hierarchical.reconcile import Reconciler
  >>> from sktime.transformations.hierarchical.aggregate import Aggregator
  >>> from sktime.utils._testing.hierarchical import _bottom_hier_datagen
  >>> agg = Aggregator()
  >>> y = _bottom_hier_datagen(
  ...     no_bottom_nodes=3,
  ...     no_levels=1,
  ...     random_seed=123,
  ... )
  >>> y = agg.fit_transform(y)
  >>> forecaster = PolynomialTrendForecaster()
  >>> forecaster.fit(y)
  PolynomialTrendForecaster(...)
  >>> prds = forecaster.predict(fh=[1])
  >>> # reconcile forecasts
  >>> reconciler = Reconciler(method="ols")
  >>> prds_recon = reconciler.fit_transform(prds)
class_docstr_tok: ["Hierarchical","reconciliation","transformer",".","Hierarchical","reconciliation","is","a","transformation","which","is","used","to","make","the","predictions","in","a","hierarchy","of","time-series","sum","together","appropriately",".","The","methods","implemented","in","this","class","only","require","the","structure","of","the","hierarchy","or","the","forecasts","values","for","reconciliation",".","These","functions","are","intended","for","transforming","hierarchical","forecasts",",","i.e",".","after","prediction",".","However","they","are","general","and","can","be","used","to","transform","hierarchical","time-series","data",".","Please","refer","to","[","1","]","_","for","further","information","Parameters","--","--","--","--","--","method",":","{","``","bu","''",",","``","ols","''",",","``","wls_str","''",",","``","td_fcst","''","}",",","default=","''","bu","''","The","reconciliation","approach","applied","to","the","forecasts","``","bu","''","-","bottom-up","``","ols","''","-","ordinary","least","squares","``","wls_str","''","-","weighted","least","squares","(","structural",")","``","td_fcst","''","-","top","down","based","on","(","forecast",")","proportions","See","Also","--","--","--","--","Aggregator","ReconcilerForecaster","References","--","--","--","--","--","..","[","1","]","https",":","\/\/otexts.com\/fpp3\/hierarchical.html","Examples","--","--","--","--",">",">",">","from","sktime.forecasting.trend","import","PolynomialTrendForecaster",">",">",">","from","sktime.transformations.hierarchical.reconcile","import","Reconciler",">",">",">","from","sktime.transformations.hierarchical.aggregate","import","Aggregator",">",">",">","from","sktime.utils._testing.hierarchical","import","_bottom_hier_datagen",">",">",">","agg","=","Aggregator","(",")",">",">",">","y","=","_bottom_hier_datagen","(","...","no_bottom_nodes=3",",","...","no_levels=1",",","...","random_seed=123",",","...",")",">",">",">","y","=","agg.fit_transform","(","y",")",">",">",">","forecaster","=","PolynomialTrendForecaster","(",")",">",">",">","forecaster.fit","(","y",")","PolynomialTrendForecaster","(","...",")",">",">",">","prds","=","forecaster.predict","(","fh=","[","1","]",")",">",">",">","#","reconcile","forecasts",">",">",">","reconciler","=","Reconciler","(","method=","''","ols","''",")",">",">",">","prds_recon","=","reconciler.fit_transform","(","prds",")"]
docstr: Add total levels to X, using Aggregate.
docstr_tok: ["Add","total","levels","to","X",",","using","Aggregate","."]
code: def _add_totals(self, X):
      """Add total levels to X, using Aggregate."""
      from sktime.transformations.hierarchical.aggregate import (
          Aggregator,
      )
  
      return Aggregator().fit_transform(X)
  
imports: import numpy
  import pandas
  from numpy.linalg import inv
  from sktime.transformations.base import BaseTransformer
  from sktime.transformations.hierarchical.aggregate import _check_index_no_total
  from sktime.utils.warnings import warn
label_desc: Use image node_id 2 for calling the Reconciler obj's underlying member method code with example usage: obj._add_totals(X) and returns: Aggregator