Skip to content

Commit

Permalink
Disable Timing Loggers by default #237. Added logging for main operat…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
antoinecarme committed Apr 2, 2023
1 parent ea18da4 commit e58b75b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyaf/TS/SignalDecomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ def reinterpret_by_signal_args(self, iTimes, iSignals, iHorizons, iExogenousData


def train(self , iInputDS, iTimes, iSignals, iHorizons, iExogenousData = None):
logger = tsutil.get_pyaf_logger();
from . import SignalDecomposition_Trainer as tstrainer

self.reinterpret_by_signal_args(iTimes, iSignals, iHorizons, iExogenousData)
# tsutil.print_pyaf_detailed_info(iInputDS.shape, iInputDS.columns, self.mSignals, self.mDateColumns, self.mHorizons)
logger.info("TRAINING_ENGINE_START " + str({"Signals" : self.mSignals, "Horizons" : self.mHorizons}));
lTimer = tsutil.cTimer(("TRAINING", {"Signals" : self.mSignals, "Horizons" : self.mHorizons}))

for sig in self.mSignals:
Expand All @@ -100,16 +102,19 @@ def train(self , iInputDS, iTimes, iSignals, iHorizons, iExogenousData = None):
for (lSignal, lBestModel) in self.mBestModels.items():
lBestModel.clean_dataframes()
del lTrainer
logger.info("TRAINING_ENGINE_END " + str(self.mTrainingTime));



def forecast(self , iInputDS, iHorizon):
logger = tsutil.get_pyaf_logger();
logger.info("FORECASTING_ENGINE_START " + str({"Signals" : self.mSignals, "Horizons" : self.mHorizons}));
from . import SignalDecomposition_Forecaster as tsforec
lTimer = tsutil.cTimer(("FORECASTING", {"Signals" : self.mSignals, "Horizon" : iHorizon}))
lForecaster = tsforec.cSignalDecompositionForecaster()
lForecastFrame = lForecaster.forecast(self, iInputDS, iHorizon)
del lForecaster

logger.info("FORECASTING_ENGINE_END " + str(lTimer.get_elapsed_time()));
return lForecastFrame;


Expand All @@ -133,8 +138,6 @@ def get_competition_details(self):
def getModelInfo(self):
for lSignal in self.mSignals:
self.mBestModels[lSignal].getInfo()
logger = tsutil.get_pyaf_logger();
logger.info("TRAINING_TIME_IN_SECONDS " + str(self.mTrainingTime));
self.get_competition_details()


Expand Down

0 comments on commit e58b75b

Please sign in to comment.