From 1e78cdc09e773774d79e87778958139051e863ee Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Wed, 7 Aug 2024 10:34:27 +0700 Subject: [PATCH] Create ai_service.py --- .../pi_network/pinnacle/src/services/ai_service.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 blockchain_integration/pi_network/pinnacle/src/services/ai_service.py diff --git a/blockchain_integration/pi_network/pinnacle/src/services/ai_service.py b/blockchain_integration/pi_network/pinnacle/src/services/ai_service.py new file mode 100644 index 000000000..dca16b1d0 --- /dev/null +++ b/blockchain_integration/pi_network/pinnacle/src/services/ai_service.py @@ -0,0 +1,14 @@ +from models.ai_model import AIModel + +class AIService: + def __init__(self, ai_model: AIModel): + self.ai_model = ai_model + + def predict(self, data: pd.DataFrame) -> pd.Series: + return self.ai_model.predict(data) + + def evaluate(self, data: pd.DataFrame) -> float: + return self.ai_model.evaluate(data) + + def train(self, data: pd.DataFrame) -> None: + self.ai_model.train(data)