Skip to content

Create BaseReconciler #1032

Closed
alex-hse-repository opened this issue Dec 7, 2022 · 0 comments
Closed

Create BaseReconciler #1032

alex-hse-repository opened this issue Dec 7, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@alex-hse-repository
Copy link
Collaborator

alex-hse-repository commented Dec 7, 2022

🚀 Feature Request

Create class to perform forecast reconcilation

Proposal

Create class:

class BaseReconciler(ABC, BaseMixin):

    def __init__(self, target_level: str, source_level: str):
        """
        target_level: level to be reconciled from the forecasts
        source_level: level to be forecasted
        """
        self.mapping_matrix: Optional[scipy.sparse.base.spmatrix]
  1. Add abstract method fit(self, ts: TSDataset) -> "BaseReconciler"
  • Receive dataset on the the level which is lower or equal than target_level, source_level
  • Aggregate the dataset to the source_level
  • Fit the parameters of the Reconciler(mapping_matrix) -- will differs in children
  1. Add method aggregate(self, ts: TSDataset) -> "TSDataset"
  • Receive dataset on the the level which is lower or equal than source_level
  • Aggregate the dataset to the source_level
  1. Add method reconcile(self, ts: TSDataset) -> TSDataset:
  • Receive dataset on source_level
  • Reconcile the forecasts form ts using mapping_matrix to the target_level
    • Y_target = G * Y_source.T
  • Create dataset with new df:
TSDataset(df=Y_target, freq=ts.freq, ...)

Test cases

  1. Method aggregate work correctly for different source_level(lower/equal/greater than level of ts)
  2. Method reconcile works correctly for top_down/bottom_up mapping matrixes and different level of input ts(lower/equal/greater than source_level)

Additional context

No response

@alex-hse-repository alex-hse-repository added the enhancement New feature or request label Dec 7, 2022
@alex-hse-repository alex-hse-repository changed the title Create Reconsiler Create BaseReconciler Dec 15, 2022
@alex-hse-repository alex-hse-repository self-assigned this Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant