tebakaja's picture
feat: crafting utilities
d7df8d0
raw
history blame
619 Bytes
from restful.cutils.utilities import Utilities
from restful.schemas import ForecastingServiceSchema
""" Forecasting Service """
class ForecastingService:
__FORECAST_UTILS = Utilities()
async def forecasting(self, payload: ForecastingServiceSchema) -> dict:
days: int = payload.days
currency: str = payload.currency
algorithm: str = payload.algorithm
actuals, predictions = await self.__FORECAST_UTILS.forecasting_utils(
days = days,
algorithm = algorithm,
model_name = currency,
sequence_length = 60
)
return {'actuals': actuals, 'predictions': predictions}