File size: 619 Bytes
0a7b47e
d7df8d0
0a7b47e
 
d7df8d0
 
0a7b47e
d7df8d0
 
 
 
 
 
 
 
0a7b47e
d7df8d0
0a7b47e
d7df8d0
0a7b47e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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}