added bot prediction for assessments

This commit is contained in:
2024-09-14 01:50:41 +00:00
parent 45bc62c745
commit cd8f499f97
14 changed files with 698 additions and 22 deletions
-5
View File
@@ -4,11 +4,6 @@ import logging
from logging.handlers import RotatingFileHandler
handler = RotatingFileHandler('/root/ds_erp_ai/logs/prediction_pipeline.log', maxBytes=100000, backupCount=3)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(handler)
class DataPreprocessor:
def __init__(self, input_path, company_id):
self.input_path = input_path
+2 -1
View File
@@ -33,7 +33,8 @@ class ModelTrainer:
y = self.df[['open_items', 'red_flags']] # Multi-target for open items and red flags
# Split into training and test sets with 10% as test size
X_train, self.X_test, y_train, self.y_test = train_test_split(X, y, test_size=0.1, random_state=42)
X_train, self.X_test, y_train, self.y_test = train_test_split(X, y, test_size=0.1, random_state=42, shuffle=False)
# Train the model
self.model.fit(X_train, y_train)