File size: 580 Bytes
0a7b47e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from restful.cutils.utilities import Utilities
from restful.schemas import CryptocurrencyPredictionSchema

class cryptocurrency_svc:
	# Prediction Utilities
	__PRED_UTILS = Utilities()

	# Prediction Service
	async def prediction(self, payload: CryptocurrencyPredictionSchema) -> dict:
		days: int     = payload.days
		currency: str = payload.currency

		actuals, predictions = await self.__PRED_UTILS.cryptocurrency_prediction_utils(
			days            = days,
			model_name      = currency,
			sequence_length = 60
		)

		return {'actuals': actuals, 'predictions': predictions}